/* Presentation layer only. Loaded last and only for PORTAL_VISUAL_THEME=earth.
   Never change iframe geometry, visibility gates, application state or TV layout. */
body.portal-earth {
  /* Same olive/clay/ink as the landing; quieter paper for long work sessions.
     Decorative dividers and interactive boundaries intentionally differ. */
  --earth-paper: #e6dfd3;
  --earth-surface: #f1ebe1;
  --earth-soft: #e4dccf;
  --earth-field: #f8f4ed;
  --earth-control: #857968;
  --earth-hover: #e6eadf;
  --earth-ink: #302b25;
  --earth-muted: #60574b;
  --earth-rule: #c3b6a2;
  --earth-olive: #536045;
  --earth-clay: #974b35;
  --primary-color: #536045;
  --primary-hover: #3d4932;
  --accent-color: #974b35;
  --lang-bg: var(--earth-surface);
  --lang-border: var(--earth-rule);
  --lang-text: var(--earth-muted);
  --lang-active: #974b35;
  --text-main: #302b25;
  --text-muted: var(--earth-muted);
  --border-soft: var(--earth-rule);
  --admin-primary: #536045;
  --admin-border: var(--earth-rule);
  --admin-bg: var(--earth-paper);
  --admin-card: var(--earth-surface);
  --admin-danger: #974b35;
  --admin-text: #302b25;
  --admin-muted: var(--earth-muted);
  --bg: var(--earth-paper);
  --card: var(--earth-surface);
  --primary: #536045;
  --primary-dark: #3d4932;
  --brand: #536045;
  --brand-strong: #3d4932;
  --panel-bg: var(--earth-surface);
  --panel-soft: var(--earth-soft);
  --surface: var(--earth-surface);
  --surface-2: var(--earth-soft);
  --text-1: #302b25;
  --text-2: var(--earth-muted);
  --modal-bg: var(--earth-surface);
  --modal-stroke: var(--earth-rule);
  --modal-shadow: 0 10px 28px rgba(48,43,37,.15);
  --help-primary: #536045;
  --help-bg: var(--earth-paper);
  --help-card: var(--earth-surface);
  --help-border: var(--earth-rule);
  --help-text: #302b25;
  --help-muted: var(--earth-muted);
  --txt-primary: #302b25;
  --txt-muted: var(--earth-muted);
  --txt-strong: #302b25;
  --border: var(--earth-control);
  --ring: var(--earth-clay);
  --btn-bg: var(--earth-field);
  --btn-border: var(--earth-control);
  --btn-hover: var(--earth-soft);
  --btn-primary-bg: var(--earth-olive);
  --btn-primary-border: var(--earth-olive);
  --btn-primary-hover: #3d4932;
  color-scheme: light;
  --warn-bg: #f0e8da;
  --warn-border: #d4c9bb;
  --warn-text: #6f4b1e;
  --success-bg: #edf1e6;
  --success-border: #bcc8ac;
  --success-text: #3f5435;
  --error-bg: #fbeee8;
  --error-border: #dfb9ab;
  --error-text: #833926;
  color: var(--earth-ink);
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
.portal-earth *, .portal-earth *::before, .portal-earth *::after { font-family: inherit; }
body.portal-earth:not(.earth-tv_view):not(.earth-index) {
  background: linear-gradient(rgba(230,223,211,.94), rgba(230,223,211,.94)), var(--empresa-bg-url, none) center / cover fixed #d8cbb7 !important;
  min-height: 100vh;
  height: auto;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 28px clamp(16px, 3vw, 48px) 48px;
}
.portal-earth :is(h1, .portal-title, .help-title, .logs-title, .dr-title) {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 400;
  letter-spacing: -.035em;
  color: var(--earth-ink);
}
.portal-earth :is(h2, h3, h4) { color: var(--earth-ink); letter-spacing: -.025em; }
.portal-earth a { color: var(--earth-clay); }
.portal-earth a:hover { text-underline-offset: 4px; }
.portal-earth :focus-visible { outline: 2px solid var(--earth-clay); outline-offset: 3px; }
.portal-earth :is(button, input, select, textarea) { font: inherit; }
.portal-earth :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea) {
  border: 1px solid var(--earth-control);
  border-radius: 7px;
  background: var(--earth-field);
  color: var(--earth-ink);
  padding: 10px 12px;
  min-height: 42px;
}
.portal-earth :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea):focus {
  border-color: var(--earth-olive);
  box-shadow: 0 0 0 3px rgba(83,96,69,.12);
}
.portal-earth :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea):focus-visible {
  outline: 2px solid var(--earth-clay);
  outline-offset: 3px;
}
.portal-earth :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea):disabled {
  background: var(--earth-soft);
  color: var(--earth-muted);
  opacity: 1;
  cursor: not-allowed;
}
.portal-earth :is(input, textarea)::placeholder { color: #766a5b; opacity: 1; }
.portal-earth :is(input[type=checkbox], input[type=radio]) { accent-color: var(--earth-olive); }
.portal-earth label { color: var(--earth-ink); font-size: .9rem; }
.portal-earth button:not(.lang-option), .portal-earth .btn,
.portal-earth :is(.btn-primario, .help-admin-link, .help-back) {
  background-color: var(--earth-olive);
  color: #fff;
  border: 1px solid var(--earth-olive);
  border-radius: 7px;
  box-shadow: 0 1px 2px rgba(48,43,37,.12);
  font-weight: 600;
  transition: background-color .15s ease, border-color .15s ease;
  cursor: pointer;
}
.portal-earth button:not(.lang-option):hover, .portal-earth .btn:hover { background-color: #3d4932; color: #fff; }
.portal-earth button:disabled, .portal-earth .btn:disabled { opacity: .5; cursor: not-allowed; }
.portal-earth :is(.btn.ghost, .btn-ghost, .btn-secondary, .help-back, button.btn-back) {
  background: var(--earth-field);
  color: var(--earth-olive);
  border: 1px solid var(--earth-control);
}
.portal-earth :is(.btn.danger, .btn-excluir, .btn-remover, .btn-excluir-grupo) {
  background: #924937;
  color: #fff;
}
.portal-earth .lang-selector { backdrop-filter: none; border-radius: 6px; }
.portal-earth .lang-option { min-width: 28px; min-height: 30px; color: var(--earth-muted); }
.portal-earth .lang-option:hover, .portal-earth .lang-option.is-active { color: var(--earth-clay); }
.portal-earth .lang-sep { color: var(--earth-rule); }
.portal-masthead {
  width: min(1280px, 100%);
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 100px 22px 0;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--earth-rule);
}
.portal-earth .portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--earth-ink);
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -1.4px;
  text-decoration: none;
  flex-shrink: 0;
}
.portal-brand img { display: block; }
.portal-brand-dot { color: var(--earth-clay); }
.portal-brand-caption { font-size: 12px; color: var(--earth-muted); }

/* Accounts, onboarding and billing: shared paper cards and quiet hierarchy. */
.portal-earth :is(.login-card, .signup-card, .config-container, .dr-card, .logs-card,
 .help-admin__panel, .coupon-panel, .policy-card, .modal-card) {
  background: var(--earth-surface);
  color: var(--earth-ink);
  border: 1px solid var(--earth-rule);
  box-shadow: 0 8px 28px rgba(63,49,33,.04);
  backdrop-filter: none;
  border-radius: 12px;
  padding: clamp(22px, 3vw, 40px);
}
.portal-earth .login-wrapper { min-height: 0; width: 100%; padding-block: 36px; }
.portal-earth .login-card { width: min(100%, 500px); }
.portal-earth .signup-wrapper { padding: 12px 0; width: 100%; }
.portal-earth .signup-card { max-width: 1080px; margin-inline: auto; }
.portal-earth .signup-card.small { max-width: 580px; }
.portal-earth :is(.subtitle, .plan-note, .sso-hint, .help-subtitle, .help-meta,
 .status-text, .dr-sub, .dr-note, .logs-sub, .logs-hint, .help-admin__hint) { color: var(--earth-muted); line-height: 1.6; }
.portal-earth .portal-title { font-size: clamp(28px, 3vw, 40px); }
.portal-earth .signup-header h1 { font-size: clamp(30px, 3vw, 42px); }
.portal-earth .form-section { border-color: var(--earth-rule); padding-block: 22px; }
.portal-earth .form-section h3 { font-size: 1.1rem; margin-bottom: 14px; }
.portal-earth :is(.divider, .divider::before, .divider::after) { border-color: var(--earth-rule); color: var(--earth-muted); }
.portal-earth .sso-buttons .btn { background: var(--earth-field); border: 1px solid var(--earth-control); color: var(--earth-ink); }
.portal-earth :is(.error-message, .status-message.error, .form-status.status-error) {
  color: #833926; background: #fbeee8; border-color: #dfb9ab;
}
.portal-earth :is(.success-message, .status-message.success, .form-status.status-success) {
  color: #3f5435; background: #edf1e6; border-color: #bcc8ac;
}
.portal-earth :is(.sso-alert, .form-status, .status-message) {
  color: var(--earth-ink); background: #f0e8da; border-color: var(--earth-rule);
}
.portal-earth .form-status.status-warning { background: #f0e8da; color: #6f4b1e; border-color: #bfa578; }
.portal-earth .dr-danger { color: var(--earth-clay); }
.portal-earth .dr-note b { color: var(--earth-clay); }
.portal-earth :is(.dr-wrap, .logs-wrap) { min-height: 0; width: 100%; padding: 12px 0; }
.portal-earth :is(.help-admin, .help-container, .subs-page) { width: min(1280px, 100%); }
.portal-earth .logs-status { color: var(--earth-clay); }
.portal-earth .modal-header, .portal-earth .modal-actions { border-color: var(--earth-rule); }
.portal-earth .modal-body { color: var(--earth-ink); }

/* Administration: readable light tables, separated settings and action groups. */
.portal-earth .container-geral {
  max-width: 1280px;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  gap: 22px;
}
.portal-earth .container-geral > h2 { text-align: left; font-size: 1.9rem; font-family: Georgia, serif; font-weight: 400; }
.portal-earth .tabs { gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--earth-rule); padding-bottom: 12px; }
.portal-earth button.tab-btn { background: var(--earth-surface); color: var(--earth-muted); border: 1px solid var(--earth-control); border-radius: 6px; padding: 10px 14px; }
.portal-earth button.tab-btn.tab-active { background: var(--earth-olive); color: white; border-color: var(--earth-olive); box-shadow: inset 0 -3px 0 #303d27; }
.portal-earth .toolbar { gap: 10px; padding-bottom: 10px; }
.portal-earth :is(.painel-detalhe, .secao, .subs-toolbar, .subs-content, .subs-log,
 .help-card, .metric-card, .chart-card) {
  background: var(--earth-surface);
  color: var(--earth-ink);
  border: 1px solid var(--earth-rule);
  border-radius: 10px;
  box-shadow: none;
}
.portal-earth .painel-detalhe { padding: 24px; gap: 24px; }
.portal-earth .secao { padding: 20px; gap: 14px; }
.portal-earth :is(.lista-usuarios-wrapper, .lista-grupos-wrapper, .logs-table-wrap,
 .subs-table-wrap, .agendar-history-wrapper, .lista-paginas-wrapper) { background: var(--earth-surface); border: 1px solid var(--earth-rule); border-radius: 8px; }
.portal-earth table { color: var(--earth-ink); }
.portal-earth :is(thead, #tabelaUsuarios thead, #tabelaGrupos thead, #agendarHistoryTable thead, #relPaginasTable thead) { background: var(--earth-soft); color: var(--earth-ink); }
.portal-earth :is(th, td) { border-color: #e5dcd0; padding: 12px 14px; }
.portal-earth :is(th) { font-size: .8rem; font-weight: 650; }
.portal-earth tbody tr { background: var(--earth-surface); }
.portal-earth tbody tr:nth-child(even) { background: #ebe4d9; }
.portal-earth :is(tbody tr, #tabelaUsuarios tbody tr, #tabelaGrupos tbody tr, #topicsTable tbody tr):hover { background: var(--earth-hover); }
.portal-earth :is(#tabelaUsuarios, #tabelaGrupos) :is(.btn-editar, .btn-copiar, .btn-editar-grupo) {
  background: var(--earth-field); color: var(--earth-olive); border: 1px solid var(--earth-control); padding: 7px 10px;
}
.portal-earth :is(.paginas-container, .empresas-container, #listaAcessosUsuario, #listaFiltrosUsuario,
 #viewRelatoriosGrupo, #viewFiltrosGrupo, #listaAcessosGrupo, #listaFiltrosGrupo) {
  background: var(--earth-surface); color: var(--earth-ink); border: 1px solid var(--earth-rule);
}
.portal-earth :is(.item-acesso, .item-filtro, .user-general-block) { border-color: var(--earth-rule); }
.portal-earth :is(.subsecao, #viewRelatoriosGrupo, #viewFiltrosGrupo) { background: var(--earth-soft); color: var(--earth-ink); padding: 16px; border: 1px solid var(--earth-rule); border-radius: 8px; }
.portal-earth .subsecao h5 { margin: 18px 0 8px; color: var(--earth-muted); font-size: .85rem; }
.portal-earth.earth-usuarios_geral :is(.grid-2, .grid-3, .grid-4) { gap: 14px; }
.portal-earth :is(.item-acesso, .item-filtro) { padding: 9px 8px; gap: 14px; }
.portal-earth .user-general-subtitle { color: var(--earth-muted); }
.portal-earth .user-option-card { background: var(--earth-surface); border-color: var(--earth-rule); color: var(--earth-ink); }
.portal-earth .user-option-card:hover, .portal-earth .user-option-card:has(input:checked) { background: var(--earth-hover); border-color: var(--earth-olive); }
.portal-earth .user-option-card input[type=checkbox] { background: var(--earth-field); border-color: var(--earth-control); }
.portal-earth .user-option-card input[type=checkbox]::before { background: var(--earth-control); }
.portal-earth .user-option-card input[type=checkbox]:checked { background: var(--earth-olive); border-color: var(--earth-olive); }
.portal-earth .filter-multi-combo > summary { background: var(--earth-field); border-color: var(--earth-control); color: var(--earth-ink); min-height: 44px; }
.portal-earth .filter-multi-panel { background: var(--earth-surface); border-color: var(--earth-rule); box-shadow: 0 12px 30px rgba(63,49,33,.12); }
.portal-earth :is(.filter-multi-option, .filter-page-group-title, .filter-multi-empty, .field-label) { color: var(--earth-ink); }
.portal-earth .filter-multi-option { background: var(--earth-field); }
.portal-earth .filter-multi-option:hover, .portal-earth .filter-multi-option:focus-within { background: var(--earth-hover); }
.portal-earth .filter-entire-report-option { border-color: var(--earth-control); }
.portal-earth .filter-page-group { border-color: var(--earth-rule); }
.portal-earth :is(.filter-actions, .filter-form-actions, .agendar-actions) { gap: 10px; }
.portal-earth .btn-link { background: transparent !important; color: var(--earth-clay) !important; }
.portal-earth .tooltip-icon { background: var(--earth-clay); }
.portal-earth .tooltip-icon::after { background: #302b25; }
.portal-earth :is(.badge-modo, .logs-tab) { background: #eee6da; color: var(--earth-ink); border-color: var(--earth-rule); }
.portal-earth button.logs-tab { background: var(--earth-surface); color: var(--earth-muted); border-color: var(--earth-control); }
.portal-earth button.logs-tab.active { background: var(--earth-olive); color: white; border-color: var(--earth-olive); }
.portal-earth .logs-title { font-size: 2rem; }
.portal-earth .help-card { padding: 26px; }
.portal-earth .help-card:hover { border-color: var(--earth-olive); background: #edf1e6; }
.portal-earth :is(.help-content, .help-empty, .help-admin__list, .help-admin__form) { color: var(--earth-ink); }
.portal-earth .help-content { background: var(--earth-surface); border-color: var(--earth-rule); }
.portal-earth .policy-header, .portal-earth .policy-footer { background: var(--earth-paper); border-color: var(--earth-rule); box-shadow: none; }
.portal-earth .policy-brand { color: var(--earth-ink); }
.portal-earth.policy-page { --ink: #302b25; --ink-muted: var(--earth-muted); --accent: #536045; }
.portal-earth.policy-page::before { opacity: 0; pointer-events: none; }
.portal-earth .policy-main { width: min(100%, 1060px); }

/* Report catalogue: all application hooks and report-open hiding remain in index.css. */
body.portal-earth.earth-index {
  --earth-home-panel: rgba(230,223,211,.65);
  /* User-approved photo veil: black at 20%, gray at 50%.
     Keep the panel transparency independent from the photo background. */
  background: linear-gradient(rgba(0,0,0,.2),rgba(141,141,141,.5)), var(--empresa-bg-url) center / cover fixed #000000 !important;
}
/* One shared background for all home trays: welcome, selectors, report grid
   and bottom actions. Do not set element opacity: controls stay opaque. */
body.portal-earth.earth-index :is(#topHeader, #reportSelectorDesktop, #topPageButtons, #topActionButtons, .welcome-card) { background: var(--earth-home-panel); backdrop-filter: none; box-shadow: none; border-color: var(--earth-rule); }
.portal-earth #topHeader { border-color: var(--earth-rule); box-shadow: none; backdrop-filter: none; padding: 14px 24px; margin-bottom: 12px; }
.portal-earth #topHeader .portal-masthead { padding-bottom: 9px; margin-bottom: 10px; }
.portal-earth #topHeader .portal-brand { font-size: 24px; }
.portal-earth #topHeader .portal-brand img { width: 30px; height: 30px; }
.portal-earth #welcomeRow { gap: 10px; }
.portal-earth #empresaLogoWrap { width: 46px; height: 46px; border-radius: 9px; flex-shrink: 0; }
.portal-earth :is(#welcomeMessage, #selectMessage, .sidebar h2) { color: var(--earth-ink); }
.portal-earth #welcomeMessage { font-family: Georgia, serif; font-size: clamp(22px, 2vw, 28px); font-weight: 400; letter-spacing: -.03em; line-height: 1.2; }
.portal-earth #selectMessage { color: var(--earth-muted); font-size: .78rem; letter-spacing: .025em; margin-top: 5px; }
.portal-earth :is(#reportSelectorDesktop, #topActionButtons, .welcome-card) { border-color: var(--earth-rule); box-shadow: none; backdrop-filter: none; }
.portal-earth #topPageButtons button {
  background: var(--earth-olive);
  color: #f8f4ed;
  border: 1px solid #3d4932;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(48,43,37,.12);
  font-weight: 500;
  font-size: .9rem;
  text-transform: none;
}
.portal-earth #topPageButtons button:hover { color: #f8f4ed; background: #3d4932; border-color: #3d4932; transform: none; }
.portal-earth #topPageButtons button:focus-visible { outline: 3px solid #974b35; outline-offset: 3px; box-shadow: inset 0 0 0 2px #f8f4ed; }
.portal-earth #topActionButtons :is(button, a) { background: var(--earth-field); color: var(--earth-olive); border: 1px solid var(--earth-control); box-shadow: 0 1px 2px rgba(48,43,37,.12); }
.portal-earth #topActionButtons :is(button, a):hover { background: #e8ecdf; color: var(--earth-olive); transform: none; }
.portal-earth #topActionButtons #gerenciarUsuarios_desktop { background: var(--earth-olive); color: #f8f4ed; border-color: #3d4932; }
.portal-earth #topActionButtons #gerenciarUsuarios_desktop:hover { background: #3d4932; color: #f8f4ed; }
.portal-earth #topActionButtons .home-logout { color: var(--earth-clay); }
.portal-earth #topActionButtons .home-logout:hover { background: #f0e2d9; color: #773b2b; border-color: var(--earth-clay); }
.portal-earth .sidebar { background: var(--earth-surface); color: var(--earth-ink); border-right: 1px solid var(--earth-rule); }
.portal-earth .sidebar .close-button { background: transparent; color: var(--earth-ink); }
.portal-earth :is(.menu-button, .search-toggle, .help-button, .zoom-controls .report-action) { background: var(--earth-olive); color: white; border-color: #d4c9bb; box-shadow: 0 4px 12px rgba(48,43,37,.14); }
.portal-earth .zoom-controls .report-action:hover,
.portal-earth .zoom-controls .report-action[aria-expanded=true] { background: #3d4932; }
.portal-earth .zoom-controls .close-report-btn { background: #974b35 !important; }
.portal-earth :is(.dataset-refresh-details, .report-view-state-status, .loading-overlay,
 .search-modal__dialog, .layout-choice-card, .empty-card, .access-blocked-card) {
  background: var(--earth-surface); color: var(--earth-ink); border-color: var(--earth-rule); box-shadow: 0 8px 30px rgba(48,43,37,.15);
}
.portal-earth :is(.dataset-refresh-note, .dataset-refresh-details dt, .layout-choice-title, .loading-text) { color: var(--earth-muted); }
.portal-earth .spinner { border-color: #d4c9bb; border-top-color: var(--earth-olive); }
.portal-earth .search-modal__header { background: #eee6da; border-color: var(--earth-rule); }
.portal-earth .welcome-card :is(p, span) { color: var(--earth-muted); }
.portal-earth .welcome-card :is(h3, strong) { color: var(--earth-ink); }
.portal-earth .welcome-step { background: var(--earth-soft); border-color: var(--earth-rule); }
.portal-earth #welcomeCard { color: var(--earth-ink); }
.portal-earth .welcome-card__step { color: var(--earth-ink); border-color: var(--earth-control); }
.portal-earth .welcome-card__step:hover { color: var(--earth-ink); border-color: var(--earth-ink); text-decoration: underline; }
.portal-earth #noReportsMessage .empty-card { background: var(--earth-surface); color: var(--earth-ink); }
.portal-earth .user-name { color: var(--earth-ink); }
.portal-earth #searchResults .search-item div { color: var(--earth-ink) !important; }
.portal-earth #searchResults .search-item:hover { background: #edf1e6; }
.portal-earth :is(.user-source-field, .draft-save-help, .unsplash-card, .unsplash-selected) { background: var(--earth-soft); border-color: var(--earth-rule); color: var(--earth-ink); }
.portal-earth .draft-save-help { border-left-color: var(--earth-olive); }
.portal-earth :is(.source-help, .unsplash-author, .unsplash-credit, .pbi-advanced-hint) { color: var(--earth-muted); }
.portal-earth .tag-herdado { background: #e8ecdf; color: #3d4932; }
.portal-earth .filter-editor-actions { gap: 10px; border-color: var(--earth-rule); }
.portal-earth .filter-editor-actions .filter-action-secondary { background: var(--earth-field); color: var(--earth-olive); border-color: var(--earth-control); }
.portal-earth .filter-editor-actions .filter-action-secondary:hover { background: #e1d6c5; color: var(--earth-ink); }
.portal-earth :is(.item-acesso, .item-filtro) button { background: var(--earth-clay); color: white; border: 1px solid var(--earth-clay); min-width: 32px; min-height: 32px; flex-shrink: 0; }
.portal-earth .agendar-alert { background: #f0e8da; color: #6f4b1e; }
.portal-earth .app-toast { background: var(--earth-surface); color: var(--earth-ink); border-color: var(--earth-rule); }
.portal-earth .app-toast.toast-error { background: #fbeee8; color: #833926; }
.portal-earth .app-toast.toast-success { background: #edf1e6; color: #3f5435; }
.portal-earth .report-view-state-status[data-kind=success] { background: #edf1e6; color: #3f5435; }
.portal-earth .report-view-state-status[data-kind=warning] { background: #f0e8da; color: #6f4b1e; }
.portal-earth .report-view-state-status[data-kind=error] { background: #fbeee8; color: #833926; }
/* TV: controls/status only. No padding, canvas/background/iframe sizing changes. */
.portal-earth.earth-tv_view #fullscreenToggle { background: #536045; color: white; }
.portal-earth.earth-tv_view .tv-status { background: #f5f0e8; color: #302b25; }

/* State pairs override BOTH foreground and background, including legacy ID
   selectors. Keep these after the shared button baseline to avoid pale text
   on pale backgrounds (or black labels on blue legacy surfaces). */
.portal-earth :is(.btn.primary, .btn-primary, .btn-primario, .filter-action-primary) { background: var(--earth-olive); color: white; border-color: var(--earth-olive); }
.portal-earth :is(.btn.primary, .btn-primary, .btn-primario, .filter-action-primary):hover { background: #3d4932; color: white; }
.portal-earth :is(button.tab-btn, button.logs-tab):not(.tab-active):not(.active):hover { background: var(--earth-hover); color: var(--earth-olive); border-color: var(--earth-olive); }
.portal-earth :is(button.btn-ghost, button.btn-secondary, button.btn-back) { background: var(--earth-field); color: var(--earth-olive); border-color: var(--earth-control); }
.portal-earth :is(.btn.ghost, .btn-ghost, button.btn-ghost, .btn-secondary, button.btn-secondary, .help-back, button.btn-back):hover { background: var(--earth-soft); color: var(--earth-olive); border-color: var(--earth-olive); }
.portal-earth :is(#btnCancelarEdicao, #btnCancelarEdicaoGrupo, #btnVoltarHome, #voltar, #togglePaginas, #btnTogglePaginas, #btnTogglePaginasGrupo) { background: var(--earth-field); color: var(--earth-olive); border: 1px solid var(--earth-control); }
.portal-earth :is(#btnCancelarEdicao, #btnCancelarEdicaoGrupo, #btnVoltarHome, #voltar, #togglePaginas, #btnTogglePaginas, #btnTogglePaginasGrupo):hover { background: var(--earth-hover); color: var(--earth-olive); border-color: var(--earth-olive); }
.portal-earth :is(.item-acesso, .item-filtro) button:hover,
.portal-earth :is(.btn.danger, .btn-excluir, .btn-remover, .btn-excluir-grupo):hover { background: #773b2b; color: white; border-color: #773b2b; }
.portal-earth :is(#tabelaUsuarios, #tabelaGrupos) :is(.btn-editar, .btn-copiar, .btn-editar-grupo):hover { background: var(--earth-hover); color: var(--earth-olive); border-color: var(--earth-olive); }
.portal-earth :is(.user-option-card, .filter-multi-option):focus-within,
.portal-earth .filter-multi-combo > summary:focus-visible,
.portal-earth .filter-editor-actions button:focus-visible { outline: 2px solid var(--earth-clay); outline-offset: 3px; }
.portal-earth.earth-usuarios_geral :is(button:not(.lang-option), .filter-multi-combo > summary) { min-height: 44px; }
.portal-earth.earth-usuarios_geral :is(.item-acesso, .item-filtro) button { min-height: 32px; }
.portal-earth :is(.item-acesso, .item-filtro) span { line-height: 1.5; }
.portal-earth :is(.paginas-header, .botoes-rodape, .botoes-inline, .unsplash-acoes) { gap: 10px; }
.portal-earth :is(.pagina-item, .dias-semana label) { background: var(--earth-field); color: var(--earth-ink); border: 1px solid var(--earth-rule); }
.portal-earth .pagina-item:hover { background: var(--earth-hover); }
.portal-earth :is(.pagina-item, .dias-semana label):has(input:checked) { background: var(--earth-hover); border-color: var(--earth-olive); }
.portal-earth :is(.filtro-grupo .tag-filtro-grupo, .tag-herdado) { background: var(--earth-hover); color: #3d4932; border: 1px solid var(--earth-rule); }
.portal-earth :is(.agendar-status-ok, .dr-lastupdate) { color: #3f5435; opacity: 1; }
.portal-earth .agendar-status-fail { color: #833926; }
.portal-earth .agendar-status-warn { color: #6f4b1e; }
.portal-earth :is(.page-sub, .audit-key, .audit-perm-key) { color: var(--earth-muted); }
.portal-earth :is(.audit-summary, .audit-value, .audit-perm-val, .logs-card details) { color: var(--earth-ink); }
.portal-earth :is(.logs-sub, .logs-hint, .logs-field label, .metric-label, .peak-title, .logs-empty) { opacity: 1; }
.portal-earth :is(.logs-table-wrap th, .subs-table th) { background: var(--earth-soft); color: var(--earth-ink); border-color: var(--earth-rule); }
.portal-earth :is(.logs-table-wrap tr:hover, .peak-list li, .logs-card details pre) { background: var(--earth-soft); border-color: var(--earth-rule); }
.portal-earth :is(#relPaginasTable input[type=text], #relPaginasTable textarea, .subs-table td input, .subs-table td select) { background: var(--earth-field); color: var(--earth-ink); border-color: var(--earth-control); }
.portal-earth :is(#relPaginasTable input[type=text], #relPaginasTable textarea, .subs-table td input, .subs-table td select):focus { border-color: var(--earth-olive); }
.portal-earth :is(#relPaginasTable input[type=text], #relPaginasTable textarea, .subs-table td input, .subs-table td select):disabled { background: var(--earth-soft); color: var(--earth-muted); }
.portal-earth :is(#painelDetalheUsuario, #painelDetalheGrupo) [aria-invalid=true] { outline: 2px solid var(--earth-clay); outline-offset: 3px; }
.portal-earth .config-container :is(h2, label, .pagina-item span),
.portal-earth #presetLinkContainer { color: var(--earth-ink); }
.portal-earth #pageSelect { background: var(--earth-soft); border: 1px solid var(--earth-rule); }
.portal-earth :is(#presetLink, .tv-link a, .unsplash-credit a, .action-link, .forgot-link) { color: var(--earth-clay); text-decoration: underline; text-underline-offset: 3px; }
.portal-earth .help-content a { text-decoration: underline; text-underline-offset: 3px; }
.portal-earth :is(.help-back, .help-admin-link) { display: inline-flex; align-items: center; padding: 10px 14px; min-height: 44px; text-decoration: none; }
.portal-earth #editor { background: var(--earth-field); color: var(--earth-ink); }
.portal-earth :is(.ql-toolbar.ql-snow, .ql-container.ql-snow) { border-color: var(--earth-control); }
.portal-earth .ql-toolbar button { background: var(--earth-field); color: var(--earth-ink); border: 1px solid var(--earth-control); margin: 2px; }
.portal-earth .ql-toolbar button:hover { background: var(--earth-hover); color: var(--earth-olive); }
.portal-earth .ql-snow .ql-stroke { stroke: var(--earth-ink); }
.portal-earth .ql-snow .ql-fill { fill: var(--earth-ink); }
.portal-earth .ql-snow .ql-picker { color: var(--earth-ink); }
.portal-earth .ql-snow .ql-picker-label { border-color: var(--earth-control); }
.portal-earth .ql-snow :is(button:hover, button.ql-active, .ql-picker-label:hover, .ql-picker-label.ql-active) .ql-stroke { stroke: var(--earth-clay); }
.portal-earth .ql-snow :is(button:hover, button.ql-active, .ql-picker-label:hover, .ql-picker-label.ql-active) .ql-fill { fill: var(--earth-clay); }
.portal-earth :is(.ql-snow .ql-picker-options, .ql-snow .ql-tooltip) { background: var(--earth-field); color: var(--earth-ink); border-color: var(--earth-control); }
.portal-earth .terms-check button { background: transparent; color: var(--earth-clay); border: 0; box-shadow: none; text-decoration: underline; }
.portal-earth .logo-preview-wrap { background: var(--earth-field); border-color: var(--earth-rule); }
.portal-earth #searchInput { background: var(--earth-field); color: var(--earth-ink); border-color: var(--earth-control) !important; }
.portal-earth #searchInput:focus { background: var(--earth-field); border-color: var(--earth-olive) !important; }
.portal-earth #searchResults { background: var(--earth-surface) !important; border-color: var(--earth-rule) !important; }
.portal-earth #searchResults :is(h4, .search-item h4) { color: var(--earth-ink); }
.portal-earth #searchModalClose { background: var(--earth-field); color: var(--earth-olive); border: 1px solid var(--earth-control); }
.portal-earth #searchModalClose:hover { background: var(--earth-hover); color: var(--earth-olive); }
.portal-earth #topPageButtons .star-icon { color: #f8f4ed; }
.portal-earth #topPageButtons .star-icon.favorito { color: #f0d28a; }
.portal-earth .sidebar :is(.report-button, .page-button) { background: var(--earth-field); color: var(--earth-olive); border: 1px solid var(--earth-control); }
.portal-earth .sidebar :is(.report-button, .page-button):hover { background: var(--earth-hover); }
.portal-earth .welcome-card__link { background: var(--earth-field); color: var(--earth-olive); border: 1px solid var(--earth-control); }
.portal-earth .welcome-card__link:hover { color: var(--earth-olive); border-color: var(--earth-olive); background: var(--earth-hover); }
.portal-earth .layout-choice-title { color: var(--earth-ink); }
.portal-earth .app-toast.toast-warning { background: #f0e8da; color: #6f4b1e; }
.portal-earth .access-blocked-logout { background: var(--earth-olive); color: white; border-color: var(--earth-olive); }
.portal-earth .access-blocked-logout:hover { background: #3d4932; color: white; }
.portal-earth .sidebar-content :is(button, a) { background: var(--earth-field); color: var(--earth-olive); border: 1px solid var(--earth-control); }
.portal-earth .sidebar-content :is(button, a):hover { background: var(--earth-hover); color: var(--earth-olive); }
.portal-earth .unsplash-watermark { background: var(--earth-surface); color: var(--earth-muted); opacity: 1; backdrop-filter: none; border-color: var(--earth-rule); }
.portal-earth .unsplash-watermark a, .portal-earth .unsplash-watermark a:hover { color: var(--earth-clay); }
.portal-earth :is(.app-toast.toast-success, .report-view-state-status[data-kind=success]) { border-color: #bcc8ac; }
.portal-earth :is(.app-toast.toast-error, .report-view-state-status[data-kind=error]) { border-color: #dfb9ab; }
.portal-earth :is(.app-toast.toast-warning, .report-view-state-status[data-kind=warning]) { border-color: #bfa578; }
.portal-earth :is(.lista-paginas-wrapper, .paginas-container, .empresas-container, #listaAcessosUsuario, #listaFiltrosUsuario, #listaAcessosGrupo, #listaFiltrosGrupo, .lista-usuarios-wrapper, .lista-grupos-wrapper, .agendar-history-wrapper, .logs-table-wrap, .subs-table-wrap, .subs-log, .coupon-table-wrap, #pageSelect, #topPageButtons, #searchResults) { scrollbar-color: var(--earth-control) var(--earth-soft); }
.portal-earth ::-webkit-scrollbar-track { background: var(--earth-soft); }
.portal-earth ::-webkit-scrollbar-thumb { background: var(--earth-control); border-color: var(--earth-soft); }
.portal-earth ::-webkit-scrollbar-thumb:hover { background: var(--earth-olive); }
.portal-earth :is(#listaAcessosUsuario, #listaFiltrosUsuario, #listaAcessosGrupo, #listaFiltrosGrupo, #detEmpresasList, #pageSelect, #topPageButtons, #searchResults, .logs-table-wrap, .subs-table-wrap, .subs-log, .coupon-table-wrap, .lista-paginas-wrapper, .agendar-history-wrapper)::-webkit-scrollbar-thumb { background: var(--earth-control); border-color: var(--earth-soft); }
.portal-earth :is(.logs-table-wrap, .subs-table-wrap, .subs-log, .coupon-table-wrap)::-webkit-scrollbar-track { background: var(--earth-soft); }

@media (max-width: 768px) {
  .portal-masthead { padding-bottom: 18px; gap: 10px; margin-bottom: 18px; }
  .portal-brand-caption { display: none; }
  .portal-earth .painel-detalhe, .portal-earth .secao { padding: 16px; }
  .portal-earth .container-geral > h2 { font-size: 1.55rem; }
  .portal-earth .tab-btn { padding: 9px 11px; font-size: .85rem; }
  .portal-earth #topHeader { padding: 16px; }
  .portal-earth #topHeader .portal-masthead { padding-right: 80px; }
  .portal-earth .toolbar :is(input, select) { min-width: 0; max-width: 100%; }
  .portal-earth :is(.help-admin__actions, .logs-actions, .subs-toolbar) { flex-wrap: wrap; gap: 8px; }
  .portal-earth .subsecao { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .portal-earth :is(button, a) { transition: none; }
}
