/*! EchoHaber R1033 | Shared theme surface and compact layout | ECHOBILISIM-ECHOHABER */
/* Only application-owned UI; never recolor news images, embeds, logos or print. */
@media screen {
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) {
    --eh-positive-bg:#16352b;--eh-positive-fg:#a7f3d0;--eh-positive-line:#376b55;
    --eh-negative-bg:#3b2228;--eh-negative-fg:#fecaca;--eh-negative-line:#80505a;
    --eh-caution-bg:#382c1a;--eh-caution-fg:#fde68a;--eh-caution-line:#806334;
    --eh-info-bg:#1b304a;--eh-info-fg:#bfdbfe;--eh-info-line:#42658c;
    color-scheme:dark;
  }
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) :is(.alert-success,.security-state.good,.news-live-chip,.badge-live,.home-newsroom-primary-badge-live,.market-info-card.is-up .market-info-change,.comment-form-feedback.is-success,.live-admin-emergency-feedback.is-success,.editor-video-upload-state.is-success,.editor-speech-status-card.is-success,.cron-health-badge.is-healthy,.cron-inline-state.is-healthy) {
    background:var(--eh-positive-bg)!important;color:var(--eh-positive-fg)!important;border-color:var(--eh-positive-line)!important;
  }
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) :is(.alert-error,.btn-danger,.security-card-icon.danger,.market-info-card.is-down .market-info-change,.comment-form-feedback.is-error,.live-admin-emergency-feedback.is-error,.editor-video-upload-state.is-error,.editor-speech-status-card.is-error,.cron-health-badge.is-danger,.cron-inline-state.is-danger,.news-management-action-count,.payout-state-message.is-locked,.verify-email-confirm-card.is-invalid .verify-email-confirm-kicker) {
    background:var(--eh-negative-bg)!important;color:var(--eh-negative-fg)!important;border-color:var(--eh-negative-line)!important;
  }
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) :is(.alert-warning,.message-disabled-notice,.payout-policy-chips .is-warning,.payout-state-message:not(.is-locked),.premium-pending-banner,.premium-pending-banner>span,.cron-health-badge.is-warning,.cron-inline-state.is-warning,.weather-settings-icon,.admin-error-icon) {
    background:var(--eh-caution-bg)!important;color:var(--eh-caution-fg)!important;border-color:var(--eh-caution-line)!important;
  }
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) :is(.alert-info,.comment-form-feedback.is-info,.live-admin-emergency-feedback.is-info) {
    background:var(--eh-info-bg)!important;color:var(--eh-info-fg)!important;border-color:var(--eh-info-line)!important;
  }
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) :is(.editor-video-upload-state,.editor-speech-status-card,.premium-pending-banner,.payout-state-message) :is(strong,small,p) {color:inherit!important}
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) .live-broadcast-human-gate .live-broadcast-start {
    background:#26354b!important;color:#f8fafc!important;border:1px solid #64748b!important;box-shadow:none!important;
  }
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) .live-broadcast-human-gate .live-broadcast-start:hover {background:#34465f!important}
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) .live-broadcast-human-gate .live-broadcast-start .ui-icon {color:#fca5a5!important}
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) :is(.panel-content,.profile-content,.rich-editor,.search-page) :is(input,textarea,select):not([type="color"]) {color-scheme:dark}
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) :is(.panel-content,.profile-content,.rich-editor,.search-page) :is(input,textarea)::placeholder {color:var(--muted,#a1adc0);opacity:1}
  /* Article series uses legacy variable names elsewhere; use the actual theme tokens here. */
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) .article-series-strip {
    background:var(--surface,#101828)!important;border-color:var(--line,#334155)!important;color:var(--text,#d0d5dd)!important;
  }
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) .article-series-strip__icon {
    background:var(--eh-info-bg)!important;color:var(--eh-info-fg)!important;
  }
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) .article-series-strip__copy small {color:var(--eh-info-fg)!important}
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) .article-series-strip__copy strong {color:var(--ink,#f8fafc)!important}
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) .article-series-strip__copy span {color:var(--muted,#a1adc0)!important}
  /* Account and panel notices: keep buttons independent and preserve the status semantics. */
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) :is(.verification-banner,.system-update-banner) {
    background:var(--eh-caution-bg)!important;color:var(--eh-caution-fg)!important;border-color:var(--eh-caution-line)!important;
  }
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) :is(.verification-banner,.system-update-banner) :is(strong,small,p) {color:inherit!important}
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) :is(.verification-banner-icon,.system-update-banner-icon) {background:transparent!important;color:var(--eh-caution-fg)!important}
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) .verify-email-confirm-card.is-invalid .verify-email-confirm-hero {
    background:linear-gradient(180deg,var(--eh-negative-bg),var(--surface,#101828))!important;
  }
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) :is(.verify-email-confirm-card.is-invalid .verify-email-confirm-icon,.market-error,.market-change.is-down,.live-editor-launch>span,.live-creation-mode-card>span) {
    background:var(--eh-negative-bg)!important;color:var(--eh-negative-fg)!important;border-color:var(--eh-negative-line)!important;
  }
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) .theme-card.active {
    background:var(--eh-positive-bg)!important;border-color:var(--eh-positive-line)!important;color:var(--eh-positive-fg)!important;
  }
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) .theme-card.active :is(strong,div>span) {color:var(--eh-positive-fg)!important}
  /* Keep native browser widgets, root canvas and scrollbars in the resolved theme. */
  html[data-resolved-theme="dark"] {color-scheme:dark}
  html[data-resolved-theme="light"] {color-scheme:light}
  .article-series-strip__copy :is(strong,span),:is(.verification-banner,.system-update-banner)>div {min-width:0;overflow-wrap:anywhere}
  :is(.verification-banner,.system-update-banner)>:is(form,a) {max-width:100%;min-width:0}
  @media(max-width:600px) {
    .article-series-strip {gap:9px;padding:11px 12px;border-radius:12px}
    .article-series-strip>.btn {white-space:normal;text-align:center;min-height:40px}
    :is(.verification-banner,.system-update-banner) {gap:9px;padding:11px 12px;align-items:stretch}
    :is(.verification-banner,.system-update-banner)>:is(form,a),.verification-banner form>.btn {width:100%}
    :is(.verification-banner,.system-update-banner) .btn {white-space:normal;text-align:center;min-height:40px}
  }
  /* Compact layout, without changing table scrolling or minimum touch targets. */
  :where(.panel-body) :is(.panel-head,.page-title-row,.panel-actions,.page-actions,.filter-bar) {gap:8px 12px;min-width:0}
  :where(.panel-body) :is(.panel-head,.page-title-row) > * {min-width:0;max-width:100%}
  :is(.profile-content,.account-overview-panel,.profile-action-center) :is(.account-overview-heading,.profile-action-center-head) > * {min-width:0;max-width:100%}
  :is(.profile-action-center-card,.account-publisher-summary,.account-premium-summary,.account-referral-summary,.profile-saved-search-item,.profile-application-status) :is(strong,small,em) {overflow-wrap:anywhere;min-width:0}
  :is(.payout-state-message,.premium-pending-banner,.comment-form-feedback,.editor-video-upload-state,.editor-speech-status-card) {min-width:0;overflow-wrap:anywhere}
  :is(.editor-video-upload-state,.editor-speech-status-card) > div {min-width:0;max-width:100%}
  :is(.editor-video-upload-state,.editor-speech-status-card) :is(strong,small,p) {min-width:0;white-space:normal;overflow-wrap:anywhere}
  :is(.panel-body,.profile-content,.account-overview-panel,.profile-action-center) :is(a,button,input,select,textarea):focus-visible {outline:2px solid var(--link,#60a5fa);outline-offset:2px}
  @media (max-width:600px) {
    :where(.panel-body) :is(.panel-head,.page-title-row,.panel-actions,.page-actions,.filter-bar) {gap:8px}
    .panel-body .panel-head:has(>.panel-actions) {display:flex;flex-wrap:wrap;align-items:flex-start}
    .panel-body .panel-head:has(>.panel-actions)>:first-child {flex:1 1 12rem}
    .panel-body .panel-head>.panel-actions {flex:0 1 auto;max-width:100%}
    :where(.panel-body) :is(.panel-actions,.page-actions,.form-actions,.filter-bar) > * {min-width:0;max-width:100%}
    :is(.payout-state-message,.premium-pending-banner,.comment-form-feedback) {padding:10px;gap:8px}
    :is(.profile-action-center-card,.profile-saved-search-item,.profile-application-status) > * {min-width:0;max-width:100%}
  }
}

/* R1032: application chrome only; preserve media, advertiser creative and brand previews. */
@media screen {
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) .theme-save-icon {
    background:var(--eh-positive-bg)!important;color:var(--eh-positive-fg)!important;border-color:var(--eh-positive-line)!important;
  }
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) :is(.skip-link,.news-video-ad-head>span) {
    background:#26354b!important;color:#f8fafc!important;border-color:#64748b!important;
  }
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark).panel-body .panel-sidebar nav a.active {
    background:#243653!important;color:#e8f0ff!important;
  }
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark).panel-body .panel-sidebar nav a.active :is(.panel-nav-text,.panel-nav-icon) {color:inherit!important}
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark).panel-body .panel-sidebar nav a.active .panel-nav-count {
    background:#344d70!important;color:#f8fafc!important;border:1px solid #64748b!important;
  }
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) :is(.news-series-admin-item,.article-facts__row) {border-color:var(--line,#293548)!important}
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) :is(.news-series-admin-icon,.article-facts__icon) {background:var(--eh-info-bg)!important;color:var(--eh-info-fg)!important}
  .news-series-admin-copy :is(strong,p,small),.news-series-title-row :is(h1,p) {overflow-wrap:anywhere;min-width:0}
  .news-series-admin-actions,.news-series-admin-actions form {min-width:0;max-width:100%}
  @media(max-width:600px) {
    .news-series-admin-grid {gap:10px;min-width:0}
    .news-series-admin-item {padding:10px;gap:8px;grid-template-columns:36px minmax(0,1fr)}
    .news-series-admin-icon {width:36px;height:36px}
    .news-series-admin-actions {grid-column:1/-1;padding-left:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
    .news-series-admin-actions :is(.btn,form) {width:100%;min-width:0;max-width:100%}
    .news-series-admin-actions .btn {min-height:40px;white-space:normal;text-align:center;justify-content:center}
    .news-series-admin-actions form:last-child {grid-column:1/-1}
    .news-series-admin-stats {gap:6px 10px}
  }
  @media(forced-colors:active) {
    .panel-body .panel-sidebar nav a.active {outline:2px solid Highlight;outline-offset:-2px}
  }
}

/* R1033: checked/unchecked settings, public account status and market indicators. */
@media screen {
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) :is(.theme-settings-page-v2 .theme-toggle-state .is-on,.market-change.is-up,.status.status-active) {
    background:var(--eh-positive-bg)!important;color:var(--eh-positive-fg)!important;border-color:var(--eh-positive-line)!important;
  }
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) .theme-settings-page-v2 .theme-toggle-state .is-off {
    background:var(--soft,#1e293b)!important;color:var(--text,#d0d5dd)!important;border-color:var(--line,#334155)!important;
  }
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) .theme-settings-page-v2 .theme-setting-toggle>input:not(:checked)+.theme-toggle-switch {
    background:#34465f;box-shadow:inset 0 0 0 1px #64748b;
  }
  /* Keep the switch thumb bright as a functional control, not a page surface. */
  .theme-settings-page-v2 .theme-setting-toggle {min-height:68px;gap:10px;padding:11px 12px;border-radius:12px}
  .theme-settings-page-v2 .theme-toggle-copy :is(strong,small) {overflow-wrap:anywhere}
  .theme-settings-page-v2 .theme-setting-toggle:has(input:focus-visible) {outline:2px solid var(--link,#60a5fa);outline-offset:2px}
  @media(max-width:600px) {
    .theme-settings-page-v2 .theme-setting-toggle {grid-template-columns:52px minmax(0,1fr);gap:5px 10px;padding:10px;min-height:68px}
    .theme-settings-page-v2 .theme-toggle-switch {grid-column:1;grid-row:1 / span 2;align-self:start;margin-top:2px}
    .theme-settings-page-v2 .theme-toggle-copy {grid-column:2;grid-row:1}
    .theme-settings-page-v2 .theme-toggle-state {grid-column:2;grid-row:2;justify-content:flex-start;min-width:0;padding:0}
    .theme-settings-page-v2 .theme-toggle-state b {min-height:22px;padding:4px 7px}
    .theme-settings-page-v2 .theme-option-card {padding:12px;gap:12px}
    .theme-settings-page-v2 .theme-range-grid {grid-template-columns:minmax(0,1fr)}
  }
  @media(forced-colors:active) {
    .theme-settings-page-v2 .theme-setting-toggle:has(input:focus-visible) {outline:2px solid Highlight}
  }
}

/* R1034: a full-width empty result is not a label/value mobile card cell.
   Keep native table semantics on desktop and horizontal-scroll tables. */
@media screen {
  .panel-body .table-wrap table tbody tr.table-empty-row > td[colspan] {
    text-align:center!important;
    white-space:normal!important;
    word-break:normal!important;
    overflow-wrap:break-word!important;
    padding:10px!important;
    border:0!important;
  }
  .panel-body .table-wrap table tbody tr.table-empty-row > td[colspan] > .empty-state {
    box-sizing:border-box;
    width:100%;min-width:0;max-width:100%;
    margin:0!important;padding:clamp(16px,4vw,28px) 12px!important;
    border-radius:12px;min-height:0;
    background:var(--surface);border-color:var(--line);
    white-space:normal!important;word-break:normal!important;overflow-wrap:break-word!important;
  }
  .panel-body .table-wrap table tbody tr.table-empty-row > td[colspan] > .empty-state :is(h2,h3,p) {
    width:auto;min-width:0;max-width:100%;margin-inline:auto;
    white-space:normal!important;word-break:normal!important;overflow-wrap:break-word!important;
    text-align:center!important;
  }
  .panel-body .table-wrap table tbody tr.table-empty-row > td[colspan] > .empty-state h3 {
    margin-block:0 6px;color:var(--ink);line-height:1.35;font-size:15px;
  }
  .panel-body .table-wrap table tbody tr.table-empty-row > td[colspan] > .empty-state p {
    margin-block:0;color:var(--muted);line-height:1.5;font-size:13px;max-width:52ch;
  }
  /* Dedicated card layouts switch at different widths; the ordinary table
     fallback must retain table-cell display above its own breakpoint. */
  @media(max-width:1240px) {
    .panel-body .table-wrap table.news-list-table tbody tr.table-empty-row {grid-template-columns:minmax(0,1fr)!important}
    .panel-body .table-wrap table.news-list-table tbody tr.table-empty-row > td[colspan] {grid-column:1/-1!important}
  }
  @media(max-width:1100px) {
    .panel-body .payout-table-panel .mobile-card-table table tbody tr.table-empty-row > td[colspan] {display:block!important;grid-column:1/-1!important;width:100%!important;max-width:100%!important;min-width:0!important}
    .panel-body .payout-table-panel .mobile-card-table table tbody tr.table-empty-row > td[colspan]::before {content:none!important;display:none!important}
  }
  @media(max-width:900px) {
    .panel-body .earnings-table-panel .mobile-card-table table tbody tr.table-empty-row > td[colspan] {display:block!important;grid-column:1/-1!important;width:100%!important;max-width:100%!important;min-width:0!important}
    .panel-body .earnings-table-panel .mobile-card-table table tbody tr.table-empty-row > td[colspan]::before {content:none!important;display:none!important}
  }
  @media(max-width:760px) {
    .panel-body .table-wrap table:is(.admin-responsive-table,.news-list-table) tbody tr > td[colspan]:only-child,
    .panel-body :is(.newsletter-responsive-table,.broadcast-history-panel .table-wrap) table tbody tr.table-empty-row > td[colspan] {
      display:block!important;grid-column:1/-1!important;grid-template-columns:minmax(0,1fr)!important;
      width:100%!important;max-width:100%!important;min-width:0!important;padding:4px!important;
      border:0!important;text-align:center!important;
    }
    .panel-body .table-wrap table:is(.admin-responsive-table,.news-list-table) tbody tr > td[colspan]:only-child::before,
    .panel-body :is(.newsletter-responsive-table,.broadcast-history-panel .table-wrap) table tbody tr.table-empty-row > td[colspan]::before {content:none!important;display:none!important}
    .panel-body .table-wrap table.admin-responsive-table tbody tr.table-empty-row {padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important}
    /* Multi-line values must not flow back into the label column. */
    .admin-body .table-wrap table.admin-responsive-table tbody tr > td:not([colspan]):has(> :nth-child(2)) {
      display:block!important;min-width:0!important;white-space:normal!important;overflow-wrap:break-word!important;
    }
    .admin-body .table-wrap table.admin-responsive-table tbody tr > td:not([colspan]):has(> :nth-child(2))::before {display:block!important;margin-bottom:5px!important}
  }
  @media(max-width:720px) {
    .panel-body .mobile-card-table table tbody tr.table-empty-row > td[colspan] {display:block!important;grid-column:1/-1!important;width:100%!important;max-width:100%!important;min-width:0!important}
    .panel-body .mobile-card-table table tbody tr.table-empty-row > td[colspan]::before {content:none!important;display:none!important}
  }
  @media(max-width:760px) {
    .admin-body form.premium-order-filter {grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
    .admin-body form.premium-order-filter > select {grid-column:1/-1!important}
    .admin-body form.premium-order-filter > :is(button,a) {min-width:0!important;min-height:44px;white-space:normal;text-align:center;justify-content:center}
  }
}
@media screen and (max-width:760px) {
  .admin-body .premium-orders-table table.admin-responsive-table .premium-order-actions {margin:0!important;max-width:100%!important}
}

/* R1036 — one filter layout, actual DOM order matches keyboard order. */
@media screen {
  .admin-body form.eh-filter-form.eh-filter-form {
    display:grid!important;grid-template-columns:repeat(auto-fit,minmax(min(100%,160px),1fr))!important;
    align-items:end!important;gap:8px!important;padding:12px!important;
    min-width:0;max-width:100%;border:1px solid var(--line);border-radius:12px;background:var(--surface);
  }
  .admin-body form.eh-filter-form.eh-filter-form > :is(input:not([type=hidden]),select,label:not(.sr-only),.eh-filter-actions) {
    grid-column:auto!important;width:100%!important;min-width:0!important;max-width:100%!important;margin:0!important;
  }
  .admin-body form.eh-filter-form > label:not(.sr-only) {min-width:0;max-width:100%}
  .admin-body form.eh-filter-form input:not([type=hidden]),.admin-body form.eh-filter-form select {
    min-width:0!important;max-width:100%!important;min-height:44px;width:100%;box-sizing:border-box;
  }
  .admin-body form.eh-filter-form.eh-filter-form > .eh-filter-actions {
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;align-items:stretch!important;
  }
  .admin-body form.eh-filter-form .eh-filter-actions > .btn {
    display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;
    min-width:0!important;max-width:100%!important;width:100%!important;min-height:44px!important;height:auto!important;
    grid-column:auto!important;grid-row:auto!important;margin:0!important;padding:9px 7px!important;font-size:13px;line-height:1.25;white-space:normal!important;text-align:center;overflow-wrap:break-word;
  }
  .admin-body form.eh-filter-form .eh-filter-actions > .btn .ui-icon {flex:0 0 auto;width:15px;height:15px}
  .admin-body form.eh-filter-form .eh-filter-date {display:grid;gap:4px;font-size:12px;font-weight:650;color:var(--muted)}
  .admin-body form.eh-filter-form .eh-filter-actions > .btn:focus-visible {outline:2px solid var(--brand);outline-offset:2px}
  @media(min-width:761px) {
    .admin-body form.eh-filter-form.eh-filter-form > .eh-filter-actions {grid-column:span 2!important}
  }
  @media(max-width:760px) {
    .admin-body form.eh-filter-form.eh-filter-form {grid-template-columns:repeat(2,minmax(0,1fr))!important;padding:10px!important}
    .admin-body form.eh-filter-form.eh-filter-form > :is(input:not([type=hidden]),label:not(.sr-only),select,.eh-filter-actions) {grid-column:1/-1!important}
    .admin-body form.eh-filter-form.eh-filter-form > .eh-filter-date {grid-column:auto!important}
  }
  @media(max-width:400px) {
    .admin-body form.eh-filter-form.eh-filter-form > .eh-filter-date {grid-column:1/-1!important}
  }
  /* Dedicated mobile lists have their own breakpoints; only adjust cells once stacked. */
  @media(max-width:720px) {
    .panel-body .table-wrap.mobile-card-table table tbody tr > td:not([colspan]):has(> :nth-child(2)) {
      display:block!important;text-align:start!important;min-width:0!important;max-width:100%;white-space:normal!important;overflow-wrap:anywhere;
    }
    .panel-body .table-wrap.mobile-card-table table tbody tr > td:not([colspan]):has(> :nth-child(2))::before {display:block!important;margin-bottom:5px!important;text-align:start!important}
    .panel-body .table-wrap.mobile-card-table table tbody tr > td:not([colspan]) > :is(form,div,small,strong,a) {min-width:0;max-width:100%;overflow-wrap:anywhere}
    .panel-body .table-wrap.mobile-card-table table tbody tr > td[colspan]:only-child {display:block!important;width:100%!important;max-width:100%!important;text-align:center!important;min-width:0!important;word-break:normal!important;overflow-wrap:break-word!important}
    .panel-body .table-wrap.mobile-card-table table tbody tr > td[colspan]:only-child::before {content:none!important;display:none!important}
  }
  /* Application-owned light surfaces found during the palette scan. */
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) :is(.weather-settings-icon,.admin-error-icon) {
    background:var(--eh-caution-bg)!important;color:var(--eh-caution-fg)!important;border-color:var(--eh-caution-line)!important;
  }
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) .publisher-create-menu.is-open .publisher-create-glyph-plus {
    background:var(--eh-info-bg)!important;color:var(--eh-info-fg)!important;border-color:var(--eh-info-line)!important;
  }
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) .verify-email-confirm-card.is-invalid .verify-email-confirm-kicker {
    background:var(--eh-negative-bg)!important;color:var(--eh-negative-fg)!important;border-color:var(--eh-negative-line)!important;
  }
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) .payout-state-message.is-locked {
    background:var(--eh-negative-bg)!important;color:var(--eh-negative-fg)!important;border-color:var(--eh-negative-line)!important;
  }
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) .eh-filter-form :is(select,input:not([type=hidden])) {
    color-scheme:dark;background-color:var(--surface)!important;color:var(--ink)!important;border-color:var(--line)!important;
  }
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) .eh-filter-form select option {background:var(--surface);color:var(--ink)}
}

@media screen and (max-width:760px) {
  /* Ledger and account Premium history had remained horizontal-scroll tables. */
  :is(.panel-body,.page-user-panel,.dashboard-public) table.eh-mobile-table {
    display:block!important;width:100%!important;min-width:0!important;max-width:100%;border:0!important;background:transparent!important;
  }
  :is(.panel-body,.page-user-panel,.dashboard-public) table.eh-mobile-table > thead {
    position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;
  }
  :is(.panel-body,.page-user-panel,.dashboard-public) table.eh-mobile-table > tbody {
    display:grid!important;grid-template-columns:minmax(0,1fr);width:100%;gap:8px;padding:4px;
  }
  :is(.panel-body,.page-user-panel,.dashboard-public) table.eh-mobile-table > tbody > tr {
    display:block!important;width:100%;min-width:0;max-width:100%;padding:9px 12px;border:1px solid var(--line);border-radius:10px;background:var(--surface);margin:0;
  }
  :is(.panel-body,.page-user-panel,.dashboard-public) table.eh-mobile-table > tbody > tr > td {
    display:block!important;width:100%!important;min-width:0!important;max-width:100%;padding:7px 0!important;text-align:start!important;white-space:normal!important;overflow-wrap:anywhere;word-break:normal;border:0!important;border-bottom:1px solid var(--line)!important;
  }
  :is(.panel-body,.page-user-panel,.dashboard-public) table.eh-mobile-table > tbody > tr > td:last-child {border-bottom:0!important}
  :is(.panel-body,.page-user-panel,.dashboard-public) table.eh-mobile-table td[data-label]::before {content:attr(data-label);display:block;font-size:11px;font-weight:700;color:var(--muted);margin-bottom:3px}
  :is(.panel-body,.page-user-panel,.dashboard-public) table.eh-mobile-table td[colspan]:only-child {text-align:center!important}
  :is(.panel-body,.page-user-panel,.dashboard-public) table.eh-mobile-table td[colspan]:only-child::before {content:none!important;display:none!important}
  :is(.panel-body,.page-user-panel,.dashboard-public) table.eh-mobile-table td > :is(strong,small,a) {max-width:100%;overflow-wrap:anywhere;white-space:normal}
  :is(.panel-body,.page-user-panel,.dashboard-public) table.eh-mobile-table td > small {display:block;color:var(--muted)}
}

/* R1038: update workflow, home labels and video controls in resolved dark mode.
   Prefer the resolved theme (including system preference); keep media itself intact. */
@media screen {
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) .pending-update.update-package-ready {
    background:var(--eh-positive-bg)!important;border-color:var(--eh-positive-line)!important;color:var(--eh-positive-fg)!important;
  }
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) .update-package-ready > p {color:var(--eh-positive-fg)!important}
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) .update-package-meta > span {
    background:var(--surface,#111827)!important;border-color:var(--line,#334155)!important;color:var(--ink,#f8fafc)!important;
  }
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) :is(.recommended-lead-badge,.home-newsroom-primary-badge:not(.home-newsroom-primary-badge-live),.home-page-pro .category-video-play,.home-video-play-badge,.headline-controls>button:hover,.headline-controls>button:focus-visible) {
    background:#26354b!important;color:#f8fafc!important;border-color:#64748b!important;box-shadow:none!important;
  }
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) :is(.recommended-lead-badge,.home-newsroom-primary-badge:not(.home-newsroom-primary-badge-live)) svg {color:#bfdbfe!important}
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) .premium-plan-card li .ui-icon {color:var(--eh-positive-fg)!important}
  /* Long build labels and package metadata must wrap without squeezing buttons. */
  .update-package-ready-head {flex-wrap:wrap;min-width:0}
  .update-package-ready-head > strong {min-width:0;max-width:100%;overflow-wrap:anywhere;line-height:1.35;font-size:clamp(16px,2vw,22px)}
  .update-package-ready .update-package-meta > span,.update-package-ready .update-retention-note > span {min-width:0;max-width:100%;overflow-wrap:anywhere}
  .update-package-ready .update-retention-note {margin:4px 0;gap:8px}
  .update-package-ready form,.update-package-ready form > .btn {min-width:0;max-width:100%;white-space:normal}
  .update-package-ready form > .btn {min-height:44px!important;line-height:1.35;text-align:center}
  :is(.recommended-lead-badge-group,.home-newsroom-primary-badge-group) {max-width:calc(100% - 28px);min-width:0}
  :is(.recommended-lead-badge-group,.home-newsroom-primary-badge-group)>b {max-width:100%;white-space:normal;overflow-wrap:break-word}
  @media(max-width:600px) {
    .update-package-ready {padding:11px;gap:9px}
    .update-package-ready .update-package-meta {grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
    .update-package-ready .update-package-meta > span {padding:8px}
    .update-package-ready .update-package-meta strong {font-size:12px;line-height:1.4}
    .update-package-ready form > .btn {min-height:44px;line-height:1.35;text-align:center}
  }
  @media(max-width:360px) {
    .update-package-ready .update-package-meta {grid-template-columns:minmax(0,1fr)}
  }
}

/* R1039: editorial revision text remains readable in resolved dark mode. */
@media screen {
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) :is(.review-revision-legend .is-added,.review-revision-diff ins) {
    color:var(--eh-positive-fg)!important;background:var(--eh-positive-bg)!important;border-color:var(--eh-positive-line)!important;
  }
  :is(html[data-resolved-theme="dark"] body,body[data-theme="dark"],body[data-resolved-theme="dark"],body.theme-dark) :is(.review-revision-legend .is-removed,.review-revision-diff del) {
    color:var(--eh-negative-fg)!important;background:var(--eh-negative-bg)!important;border-color:var(--eh-negative-line)!important;
  }
  .review-revision-field summary {flex-wrap:wrap;overflow-wrap:anywhere;min-width:0}
  .review-revision-field summary b {white-space:normal;max-width:100%;overflow-wrap:anywhere}
  .review-revision-legend>span {max-width:100%;min-width:0;overflow-wrap:break-word}
  @media(max-width:600px) {
    .review-revision-panel {padding:10px;gap:8px}
    .review-revision-field summary {padding:9px 10px;min-height:44px;box-sizing:border-box}
    .review-revision-diff {font-size:12px;line-height:1.65}
  }
}
