/* UI_THEME_COMPLETE_V24_20260729
   Final theme coverage for dialogs, generated analysis results, AI chat, robot bubble,
   40/60 web-monitor layout, and scrollable theme gallery.
*/

html[data-dashboard-theme]{
  --theme-dialog-overlay:color-mix(in srgb,var(--theme-page) 58%,transparent);
  --theme-surface-raised:color-mix(in srgb,var(--theme-surface) 94%,var(--theme-primary-soft));
  --theme-surface-inset:color-mix(in srgb,var(--theme-surface-soft) 91%,var(--theme-primary-soft));
  --theme-row-alt:color-mix(in srgb,var(--theme-surface-soft) 86%,var(--theme-primary-soft));
  --theme-chip:color-mix(in srgb,var(--theme-surface) 82%,var(--theme-primary-soft));
}

/* ---------- All settings/history dialogs ---------- */
html[data-dashboard-theme] dialog::backdrop{
  background:var(--theme-dialog-overlay)!important;
  backdrop-filter:blur(7px) saturate(.9)!important;
}
html[data-dashboard-theme] :is(
  dialog.settings-dialog,dialog.mini-list-dialog,dialog.mail-base64-dialog,
  .settings-card,.mini-list-card,.mail-base64-dialog__shell
){
  color:var(--theme-text)!important;
}
html[data-dashboard-theme] :is(
  .settings-card,.mini-list-card,.mail-base64-dialog__shell,
  .history-card,.shot-preview-card,.theme-settings-card,
  .dashboard-name-settings-card,.account-manage-card
){
  background:var(--theme-surface)!important;
  border-color:var(--theme-line)!important;
  box-shadow:0 24px 72px var(--theme-shadow)!important;
}
html[data-dashboard-theme] :is(
  .dialog-head,.theme-dialog-head,.mini-list-head,.mail-base64-dialog__head,
  .history-toolbar,.dialog-actions,.theme-dialog-actions
){
  background:linear-gradient(135deg,var(--theme-surface-inset),var(--theme-surface-raised))!important;
  color:var(--theme-heading)!important;
  border-color:var(--theme-line)!important;
}
html[data-dashboard-theme] :is(
  .settings-tabbar,.settings-tab-panel,.sub-panel,.template-guide,
  .history-filter,.history-bulk-actions,.outage-history-list,
  .folder-toolbar,.folder-list,.source-url-panel,.source-url-grid,
  .source-url-card,.source-url-test-date,.source-url-test-result,
  .source-url-external-list,.external-site-panel,.external-site-form,
  .external-site-list,.external-site-test,.external-site-actions,
  .url-manage-list,.url-manage-item,.url-manage-main,.source-discovery-field,
  .institution-news-guide,.schedule-time-row,.news-source-list,
  .pretty-list,.pretty-list-item,.keyword-scroll-list,.keyword-row,
  .empty-pretty,.mini-list-body
){
  background:var(--theme-surface-soft)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
  box-shadow:none!important;
}
html[data-dashboard-theme] :is(
  .source-url-card,.url-manage-item,.pretty-list-item,.schedule-time-row,
  .keyword-row,.folder-list>*,.outage-history-list>*,.external-site-list>*
){
  background:var(--theme-surface)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
}
html[data-dashboard-theme] :is(
  .url-manage-title strong,.pretty-list-title,.folder-list strong,
  .external-site-list strong,.source-url-card strong,.history-toolbar label,
  .dialog-head h2,.mini-list-head h2,.settings-tab-panel h3,.settings-tab-panel h4
){color:var(--theme-heading)!important}
html[data-dashboard-theme] :is(
  .url-manage-url,.pretty-list-url,.pretty-list-meta,.source-discovery-hint,
  .empty-pretty,.folder-list small,.external-site-list small,.history-toolbar span,
  .dialog-subtitle,.settings-tab-panel small
){color:var(--theme-muted)!important}
html[data-dashboard-theme] :is(.settings-tab,.mini-view-btn,.mail-dialog-close){
  background:var(--theme-surface)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line-strong)!important;
}
html[data-dashboard-theme] :is(.settings-tab.is-active,.settings-tab[aria-selected="true"]){
  background:linear-gradient(135deg,var(--theme-primary-soft),var(--theme-accent-soft))!important;
  color:var(--theme-primary-strong)!important;
  border-color:var(--theme-primary)!important;
}

/* ---------- VirusTotal generated report ---------- */
html[data-dashboard-theme] :is(
  .vt-result,.vt-report-card,.vt-report-head,.vt-metric-grid,.vt-metric,
  .vt-detail-box,.vt-detail-grid,.vt-engine-list,.vt-engine-row,
  .vt-tag-list,.vt-category-list,.vt-report-foot,.vt-empty-inline,
  .ip-selected-detail,.intel-new-detail
){
  background:var(--theme-surface)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
  box-shadow:none!important;
}
html[data-dashboard-theme] :is(.vt-report-head,.vt-report-foot,.vt-detail-box>summary){
  background:var(--theme-surface-soft)!important;
  color:var(--theme-heading)!important;
  border-color:var(--theme-line)!important;
}
html[data-dashboard-theme] :is(
  .vt-metric,.vt-detail-grid>div,.vt-engine-row,.vt-category-list>div,.vt-tag-list>span
){
  background:var(--theme-surface-inset)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
}
html[data-dashboard-theme] :is(
  .vt-report-card h3,.vt-detail-grid b,.vt-engine-row b,.vt-category-list b,
  .vt-verdict strong,.vt-metric strong
){color:var(--theme-heading)!important}
html[data-dashboard-theme] :is(
  .vt-report-card p,.vt-detail-grid dt,.vt-engine-row small,.vt-report-foot span,
  .vt-verdict small,.vt-metric span,.vt-empty-inline
){color:var(--theme-muted)!important}

/* ---------- Mail analysis: authentication, route, URL, attachment cards ---------- */
html[data-dashboard-theme] :is(
  .mail-security-summary,.mail-security-metrics,.mail-security-grid,
  .mail-security-grid article,.mail-security-note,.mail-indicator-list,
  .mail-indicator-list button,.mail-indicator-list span,.mail-summary,
  .mail-file-meta,.mail-file-meta>div,.mail-attachment-list,.mail-attachment,
  .mail-content-box,.mail-plain-content,.mail-code-content,.mail-empty,
  .mail-analysis-empty,.mail-ai-analysis,.mail-ai-meta,.mail-ai-content,
  .mail-ai-analysis__foot
){
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
}
html[data-dashboard-theme] :is(
  .mail-security-summary,.mail-security-grid article,.mail-content-box,
  .mail-ai-analysis,.mail-attachment,.mail-summary table
){background:var(--theme-surface)!important}
html[data-dashboard-theme] :is(
  .mail-security-metrics,.mail-security-metrics article,.mail-security-note,
  .mail-indicator-list button,.mail-indicator-list span,.mail-file-meta>div,
  .mail-attachment-list,.mail-analysis-empty,.mail-empty,.mail-ai-meta,
  .mail-ai-analysis__foot,.mail-tabs,.mail-tab-panel
){background:var(--theme-surface-soft)!important}
html[data-dashboard-theme] :is(
  .mail-security-summary h3,.mail-security-grid h4,.mail-security-metrics strong,
  .mail-attachment strong,.mail-file-meta dd,.mail-summary h3,.mail-summary td,
  .mail-analysis-empty strong,.mail-ai-analysis__title strong,.mail-ai-meta strong
){color:var(--theme-heading)!important}
html[data-dashboard-theme] :is(
  #mailRiskHeadline,.mail-security-grid ul,.mail-security-note,
  .mail-security-metrics span,.mail-attachment span,.mail-file-meta dt,
  .mail-analysis-empty p,.mail-empty,.mail-ai-analysis__title small,
  .mail-ai-analysis__foot
){color:var(--theme-muted)!important}
html[data-dashboard-theme] .mail-summary th{
  background:var(--theme-primary-soft)!important;
  color:var(--theme-primary-strong)!important;
  border-color:var(--theme-line)!important;
}
html[data-dashboard-theme] .mail-summary td{
  background:var(--theme-surface)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
}
html[data-dashboard-theme] .mail-plain-content{background:var(--theme-surface)!important;color:var(--theme-text)!important}
html[data-dashboard-theme] .mail-code-content{background:var(--theme-code-bg)!important;color:var(--theme-text)!important}
html[data-dashboard-theme] .mail-content-box iframe{background:#fff!important;color-scheme:light!important}

/* ---------- File analysis: all cards, tabs, tables, viewer, empty state ---------- */
html[data-dashboard-theme] :is(
  .hex-analyzer-page,.hex-workspace,.hex-analysis-summary,.hex-auto-summary,
  .hex-file-hero,.hex-metric-card,.hex-ai-analysis,.hex-warning-panel,
  .hex-main-grid,.hex-side-panel,.hex-content-panel,.hex-side-section,
  .hex-analysis-empty,.hex-result-area,.hex-tabs,.hex-tab-panel,
  .hex-structure-summary,.hex-structure-summary article,.hex-structure-block,
  .hex-ioc-grid,.hex-ioc-grid article,.hex-string-toolbar,.hex-string-list,
  .hex-string-row,.hex-chip-list,.hex-chip-list button,.hex-search-results,
  .hex-empty-inline,.hex-entropy-summary,.hex-entropy-summary>div,
  .hex-entropy-chart-wrap,.hex-entropy-legend,.hex-view-toolbar,
  .hex-viewer,.hex-viewer-head,.hex-row,.hex-view-foot,.hex-disclaimer,
  .hex-hash-list>div,.hex-offset-radix-row,.hex-offset-form,.hex-search-form,
  .hex-decoded-download-controls,.hex-upload-progress
){
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
}
html[data-dashboard-theme] :is(
  .hex-analysis-summary,.hex-auto-summary,.hex-file-hero,.hex-ai-analysis,
  .hex-warning-panel,.hex-side-panel,.hex-content-panel,.hex-structure-block,
  .hex-ioc-grid article,.hex-string-row,.hex-entropy-summary>div,.hex-hash-list>div
){background:var(--theme-surface)!important}
html[data-dashboard-theme] :is(
  .hex-analysis-empty,.hex-tabs,.hex-tab-panel,.hex-side-section,
  .hex-structure-summary article,.hex-chip-list button,.hex-search-results,
  .hex-empty-inline,.hex-entropy-chart-wrap,.hex-string-list,.hex-view-toolbar,
  .hex-view-foot,.hex-disclaimer,.hex-upload-progress
){background:var(--theme-surface-soft)!important}
html[data-dashboard-theme] :is(
  .hex-file-hero h2,.hex-metric-card strong,.hex-section-title strong,
  .hex-panel-heading h3,.hex-structure-summary strong,.hex-string-row code,
  .hex-entropy-summary strong,.hex-ai-analysis__title strong,.hex-auto-summary h2,
  .hex-auto-summary h3,.hex-hash-list code
){color:var(--theme-heading)!important}
html[data-dashboard-theme] :is(
  .hex-file-kicker,.hex-file-hero p,.hex-metric-card span,.hex-metric-card small,
  .hex-section-title small,.hex-field-help,.hex-panel-heading p,
  .hex-structure-summary span,.hex-string-row small,.hex-list-note,
  .hex-entropy-summary span,.hex-view-foot,.hex-disclaimer,.hex-ai-meta,
  .hex-ai-analysis__foot,.hex-analysis-empty p
){color:var(--theme-muted)!important}
html[data-dashboard-theme] .hex-analysis-empty>span,
html[data-dashboard-theme] .hex-auto-summary__title>span{
  background:var(--theme-primary-soft)!important;
  color:var(--theme-primary-strong)!important;
}
html[data-dashboard-theme] .hex-viewer,
html[data-dashboard-theme] .hex-viewer-head{
  background:var(--theme-code-bg)!important;
  color:var(--theme-text)!important;
}
html[data-dashboard-theme] .hex-row{background:var(--theme-code-bg)!important}
html[data-dashboard-theme] .hex-row:nth-child(even){background:color-mix(in srgb,var(--theme-code-bg) 88%,var(--theme-primary-soft))!important}
html[data-dashboard-theme] .hex-row:hover{background:var(--theme-hover-bg,var(--theme-primary-soft))!important}
html[data-dashboard-theme] .hex-row.is-selected{background:var(--theme-warning-soft)!important}
html[data-dashboard-theme] .hex-data-table :is(th,td){border-color:var(--theme-line)!important;color:var(--theme-text)!important}
html[data-dashboard-theme] .hex-data-table th{background:var(--theme-primary-soft)!important;color:var(--theme-primary-strong)!important}
html[data-dashboard-theme] .hex-data-table td{background:var(--theme-surface)!important}

/* ---------- AI assistant answers and compose box ---------- */
html[data-dashboard-theme] :is(
  .ai-message-list,.ai-empty-chat,.ai-assistant-card,.ai-answer-content,
  .ai-answer-keyline,.ai-lookup-summary,.ai-message__bubble,.ai-compose,
  .ai-compose textarea,.ai-copy-button,.ai-empty-chat__examples span
){
  border-color:var(--theme-line)!important;
  color:var(--theme-text)!important;
}
html[data-dashboard-theme] .ai-message-list{
  background:linear-gradient(145deg,var(--theme-surface-soft),var(--theme-page-2))!important;
}
html[data-dashboard-theme] :is(.ai-empty-chat,.ai-assistant-card,.ai-answer-content,.ai-compose){
  background:var(--theme-surface)!important;
}
html[data-dashboard-theme] :is(.ai-answer-keyline,.ai-lookup-summary,.ai-copy-button,.ai-empty-chat__examples span){
  background:var(--theme-surface-soft)!important;
}
html[data-dashboard-theme] :is(
  .ai-message__identity strong,.ai-empty-chat strong,.ai-answer-content h3,
  .ai-answer-content strong,.ai-answer-keyline>strong
){color:var(--theme-heading)!important}
html[data-dashboard-theme] :is(
  .ai-message__identity small,.ai-message__user-meta,.ai-message__user-meta small,
  .ai-empty-chat,.ai-empty-chat p,.ai-compose-foot
){color:var(--theme-muted)!important}
html[data-dashboard-theme] .ai-message--assistant .ai-message__bubble,
html[data-dashboard-theme] .ai-assistant-card{
  background:var(--theme-surface)!important;
  color:var(--theme-text)!important;
}
html[data-dashboard-theme] .ai-message--user .ai-message__bubble{
  background:var(--theme-button-gradient)!important;
  border-color:transparent!important;
  color:#fff!important;
}
html[data-dashboard-theme] .ai-compose textarea{
  background:var(--theme-surface-inset)!important;
  color:var(--theme-text)!important;
}
html[data-dashboard-theme] .ai-answer-content code{
  background:var(--theme-code-bg)!important;
  color:var(--theme-primary-strong)!important;
}
html[data-dashboard-theme] .ai-answer-keyline>span{
  background:var(--theme-primary-soft)!important;
  color:var(--theme-primary-strong)!important;
}

/* ---------- Remember-ID rows and custom checkboxes ---------- */
html[data-dashboard-theme] :is(.topbar-login-remember,.admin-remember-id){
  background:var(--theme-surface-soft)!important;
  color:var(--theme-text)!important;
  border:1px solid var(--theme-line)!important;
  border-radius:12px!important;
  padding:9px 10px!important;
}
html[data-dashboard-theme] :is(.topbar-login-remember span,.admin-remember-id span){color:var(--theme-heading)!important}
html[data-dashboard-theme] .topbar-login-remember small{color:var(--theme-muted)!important}
html[data-dashboard-theme] :is(.topbar-login-remember input,.admin-remember-id input){
  appearance:none!important;
  -webkit-appearance:none!important;
  width:17px!important;height:17px!important;min-width:17px!important;
  margin:0!important;padding:0!important;
  border:1px solid var(--theme-line-strong)!important;
  border-radius:5px!important;
  background:var(--theme-surface)!important;
  box-shadow:none!important;
  display:grid!important;place-content:center!important;
}
html[data-dashboard-theme] :is(.topbar-login-remember input,.admin-remember-id input):checked{
  background:var(--theme-primary)!important;
  border-color:var(--theme-primary)!important;
}
html[data-dashboard-theme] :is(.topbar-login-remember input,.admin-remember-id input):checked::after{
  content:"✓"!important;color:#fff!important;font-size:12px!important;font-weight:900!important;line-height:1!important;
}

/* ---------- Robot emotion speech bubble ---------- */
html[data-dashboard-theme] .ai-robot-emotion-bubble{
  background:var(--theme-surface)!important;
  color:var(--theme-heading)!important;
  border-color:var(--theme-line-strong)!important;
  box-shadow:0 12px 30px var(--theme-shadow)!important;
}
html[data-dashboard-theme] .ai-robot-emotion-bubble::after{
  background:var(--theme-surface)!important;
  border-right-color:var(--theme-line-strong)!important;
  border-bottom-color:var(--theme-line-strong)!important;
}
html[data-dashboard-theme] .ai-robot-emotion-note{color:var(--theme-primary)!important;text-shadow:0 2px 0 var(--theme-surface)!important}
html[data-dashboard-theme] .ai-robot-emotion-shadow{background:var(--theme-shadow)!important}

/* ---------- Web monitor: 40% URL grid / 60% preview ---------- */
@media(min-width:1121px){
  html[data-dashboard-theme] .dashboard-layout--classic{
    grid-template-columns:minmax(440px,40fr) minmax(0,60fr)!important;
  }
}

/* ---------- Scrollable theme gallery ---------- */
html[data-dashboard-theme] .theme-settings-dialog{
  width:min(1120px,calc(100vw - 28px))!important;
  max-height:92vh!important;
  overflow:hidden!important;
}
html[data-dashboard-theme] .theme-settings-card{
  display:flex!important;
  flex-direction:column!important;
  max-height:92vh!important;
  overflow:hidden!important;
}
html[data-dashboard-theme] .theme-settings-body{
  flex:1 1 auto!important;
  min-height:0!important;
  overflow-y:auto!important;
  overscroll-behavior:contain!important;
  scrollbar-gutter:stable!important;
  padding-right:8px!important;
}
html[data-dashboard-theme] .theme-library{
  overflow:visible!important;
  max-height:none!important;
}
html[data-dashboard-theme] .theme-dialog-head,
html[data-dashboard-theme] .theme-dialog-actions{
  flex:0 0 auto!important;
  position:relative!important;
  z-index:2!important;
}

@media(max-width:760px){
  html[data-dashboard-theme] .theme-settings-dialog{max-height:96vh!important}
  html[data-dashboard-theme] .theme-settings-card{max-height:96vh!important}
  html[data-dashboard-theme] .theme-settings-body{padding-right:3px!important}
}
