/* UI_THEME_FIELDS_V26_20260729
   Field-level theme coverage for monitoring, advisory, news, VirusTotal, AI and admin account areas.
*/

/* Theme-aware field cards: explicit wrappers beat legacy fixed white panels. */
html[data-dashboard-theme] .theme-field-card,
html[data-dashboard-theme] .settings-card .form-grid > label.theme-field-card,
html[data-dashboard-theme] .settings-card .theme-field-card--schedule{
  display:grid!important;
  gap:8px!important;
  min-width:0!important;
  padding:12px 13px!important;
  border:1px solid var(--theme-line)!important;
  border-radius:14px!important;
  background:linear-gradient(155deg,var(--theme-surface),var(--theme-surface-soft))!important;
  color:var(--theme-heading)!important;
  box-shadow:0 7px 18px var(--theme-shadow-soft)!important;
}
html[data-dashboard-theme] .theme-field-card > :is(span,strong,small),
html[data-dashboard-theme] .theme-field-card .telegram-send-switch__copy :is(strong,small){
  color:inherit!important;
}
html[data-dashboard-theme] .theme-field-card > small,
html[data-dashboard-theme] .theme-field-card .field-help{color:var(--theme-muted)!important}
html[data-dashboard-theme] .theme-field-card :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea),
html[data-dashboard-theme] .theme-field-card .secret-input{
  background:var(--theme-surface-inset)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line-strong)!important;
}
html[data-dashboard-theme] .theme-field-card :is(input,select,textarea):focus{
  border-color:var(--theme-primary)!important;
  box-shadow:0 0 0 3px var(--theme-focus)!important;
}
html[data-dashboard-theme] .theme-field-card .secret-toggle{
  background:var(--theme-surface-soft)!important;
  color:var(--theme-primary-strong)!important;
  border-color:var(--theme-line)!important;
}
html[data-dashboard-theme] .theme-field-card :is(input,select,textarea)::placeholder{
  color:var(--theme-muted)!important;
  opacity:.78!important;
}

/* Schedule rows are generated dynamically. */
html[data-dashboard-theme] [data-news-settings-panel="schedule"] :is(.schedule-time-editor,.schedule-time-row),
html[data-dashboard-theme] [data-news-settings-panel="institution"] .institution-news-guide,
html[data-dashboard-theme] [data-news-settings-panel="sources"] :is(.source-discovery-field,.news-source-list){
  border-color:var(--theme-line)!important;
  background:var(--theme-surface)!important;
  color:var(--theme-text)!important;
}
html[data-dashboard-theme] [data-news-settings-panel="schedule"] .schedule-time-row :is(select,input),
html[data-dashboard-theme] [data-news-settings-panel="sources"] .source-discovery-field :is(input,select,textarea){
  background:var(--theme-surface-inset)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line-strong)!important;
}

/* All requested settings panels: eliminate fixed white label cells. */
html[data-dashboard-theme] :is(
  [data-dashboard-settings-panel="monitor"],
  [data-dashboard-settings-panel="telegram"],
  [data-dashboard-settings-panel="sites"],
  [data-notice-settings-panel="monitor"],
  [data-notice-settings-panel="gmail"],
  [data-notice-settings-panel="telegram"],
  [data-notice-settings-panel="external"],
  [data-news-settings-panel="schedule"],
  [data-news-settings-panel="institution"],
  [data-news-settings-panel="telegram"],
  [data-news-settings-panel="sources"]
) .form-grid > label:not(.checkbox-line):not(.telegram-send-switch):not(.theme-field-card){
  padding:12px 13px!important;
  border:1px solid var(--theme-line)!important;
  border-radius:14px!important;
  background:var(--theme-surface)!important;
  color:var(--theme-heading)!important;
}

/* External security-site condition stays visible and truthful after save. */
html[data-dashboard-theme] .external-keyword-mode{
  display:inline-flex!important;
  align-items:center!important;
  width:max-content!important;
  padding:5px 9px!important;
  border:1px solid var(--theme-line)!important;
  border-radius:999px!important;
  background:var(--theme-primary-soft)!important;
  color:var(--theme-primary-strong)!important;
  font-size:11px!important;
  font-weight:900!important;
}
html[data-dashboard-theme] .external-keyword-mode--and{
  background:var(--theme-accent-soft)!important;
  color:var(--theme-accent)!important;
}
html[data-dashboard-theme] .external-site-card[data-keyword-mode="AND"]{
  border-left:4px solid var(--theme-accent)!important;
}
html[data-dashboard-theme] .external-site-card[data-keyword-mode="OR"]{
  border-left:4px solid var(--theme-primary)!important;
}

/* VirusTotal analysis-target artwork and query panel. */
html[data-dashboard-theme] .intel-new-page--vt :is(.intel-new-header,.intel-new-query--vt,.intel-new-panel-head,.intel-new-input-mode,.intel-new-tabs--vt,.intel-new-clean-summary){
  background:var(--theme-surface)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
}
html[data-dashboard-theme] .intel-new-page--vt .intel-new-header{
  background:linear-gradient(135deg,var(--theme-surface),var(--theme-primary-soft))!important;
}
html[data-dashboard-theme] .intel-new-heading__icon--vt,
html[data-dashboard-theme] .intel-new-page--vt .intel-new-panel-head__num{
  background:var(--theme-icon-surface)!important;
  color:var(--theme-primary-strong)!important;
  border:1px solid var(--theme-line)!important;
  box-shadow:0 8px 20px var(--theme-shadow-soft)!important;
}
html[data-dashboard-theme] .intel-new-query--vt::before{
  background:linear-gradient(90deg,var(--theme-primary),var(--theme-accent))!important;
}
html[data-dashboard-theme] .intel-new-page--vt :is(.intel-new-heading h2,.intel-new-panel-head h3,.intel-new-label){color:var(--theme-heading)!important}
html[data-dashboard-theme] .intel-new-page--vt :is(.intel-new-heading p,.intel-new-panel-head p,.field-help){color:var(--theme-muted)!important}

/* AI read-only analysis and API state: red when absent, green when usable. */
html[data-dashboard-theme] .ai-readonly-note{
  border:1px solid var(--theme-line)!important;
  background:linear-gradient(135deg,var(--theme-primary-soft),var(--theme-surface))!important;
  color:var(--theme-primary-strong)!important;
  box-shadow:none!important;
}
html[data-dashboard-theme] .ai-readonly-note :is(span,p){color:inherit!important}
html[data-dashboard-theme] .ai-config-state,
html[data-dashboard-theme] .ai-status-dot{
  border-width:1px!important;
  border-style:solid!important;
  box-shadow:none!important;
}
html[data-dashboard-theme] .ai-config-state.is-unconfigured,
html[data-dashboard-theme] .ai-status-dot.is-unconfigured,
html[data-dashboard-theme] .ai-unconfigured-banner{
  background:var(--theme-danger-soft)!important;
  color:var(--theme-danger)!important;
  border-color:color-mix(in srgb,var(--theme-danger) 48%,var(--theme-line))!important;
}
html[data-dashboard-theme] .ai-config-state.is-ready,
html[data-dashboard-theme] .ai-status-dot.is-ready,
html[data-dashboard-theme] #openAiApiStatusBtn.is-configured{
  background:var(--theme-success-soft)!important;
  color:var(--theme-success)!important;
  border-color:color-mix(in srgb,var(--theme-success) 48%,var(--theme-line))!important;
}
html[data-dashboard-theme] .ai-status-dot.is-busy{
  background:var(--theme-warning-soft)!important;
  color:var(--theme-warning)!important;
  border-color:color-mix(in srgb,var(--theme-warning) 48%,var(--theme-line))!important;
}
html[data-dashboard-theme] .ai-unconfigured-banner :is(strong,span){color:inherit!important}

/* Administrator account-name areas. */
html[data-dashboard-theme] .theme-account-name,
html[data-dashboard-theme] .admin-user-badge,
html[data-dashboard-theme] .account-manage-item :is(.account-name,.account-username,strong),
html[data-dashboard-theme] .account-manage-list [data-account-username]{
  border-color:var(--theme-line)!important;
  background:linear-gradient(135deg,var(--theme-primary-soft),var(--theme-accent-soft))!important;
  color:var(--theme-primary-strong)!important;
}
html[data-dashboard-theme] #newAccountUsername,
html[data-dashboard-theme] #adminUsername{
  background:var(--theme-surface-inset)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line-strong)!important;
}

/* Native controls and select dropdowns follow the selected light/dark color scheme. */
html[data-dashboard-theme] :is(
  #cfgPing,#cfgLimit,#cfgFail,#cfgToken,#cfgChat,#newSiteName,#newSiteUrl,
  #cfgInterval,#cfgRetentionDays,#cfgSaveDir,#cfgSubjectPrefix,#cfgMailTo,#cfgGmail,#cfgGmailPw,
  #externalSiteName,#externalSiteKeywordMode,#externalSiteUrl,#externalSiteKeywords,
  #cfgMaxSend,#cfgMaxItems,#cfgKeywords,#cfgInstitutionName,#cfgInstitutionKeywords,#newSourceName
){
  color-scheme:inherit!important;
  background:var(--theme-surface-inset)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line-strong)!important;
}

/* Reservation-time picker itself is a field group, not a label. */
html[data-dashboard-theme] [data-news-settings-panel="schedule"] .schedule-time-picker{
  padding:12px 13px!important;
  border:1px solid var(--theme-line)!important;
  border-radius:14px!important;
  background:linear-gradient(155deg,var(--theme-surface),var(--theme-surface-soft))!important;
  color:var(--theme-text)!important;
  box-shadow:0 7px 18px var(--theme-shadow-soft)!important;
}
html[data-dashboard-theme] [data-news-settings-panel="schedule"] .schedule-time-picker :is(strong,h3){color:var(--theme-heading)!important}
html[data-dashboard-theme] [data-news-settings-panel="schedule"] .schedule-time-picker :is(small,span){color:var(--theme-muted)!important}
