.admin-grid > .prediction-insights { grid-column: 1 / -1; min-width: 0; max-width: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; }
.prediction-insights [hidden] { display: none !important; }
.prediction-insights h2 { font-size: 26px; margin: 0; }
.prediction-insights h3 { font-size: 21px; margin: 0 0 12px; }
.prediction-insights h4 { font-size: 17px; }
.prediction-head, .prediction-actions, .prediction-filters { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.prediction-head { justify-content: space-between; margin-bottom: 12px; }
.prediction-insights button { min-height: 42px; height: auto; padding: 10px 14px; line-height: 1.3; font-size: 14px; white-space: normal; overflow-wrap: anywhere; border-radius: 6px; }
.prediction-insights label { display: grid; gap: 6px; font-size: 14px; min-width: 0; }
.prediction-insights input, .prediction-insights select, .prediction-insights textarea { min-width: 0; max-width: 100%; min-height: 42px; height: auto; padding: 10px 12px; font-size: 15px; border-radius: 6px; }
.prediction-filters { align-items: end; margin: 20px 0; }
.prediction-filters label { flex: 0 1 235px; }
.prediction-filters > span { font-size: 13px; color: var(--muted); flex: 1 1 200px; padding: 10px 0; }
.prediction-modes.admin-subwindow-tabs { display: flex; flex-wrap: wrap; width: fit-content; max-width: 100%; margin: 0 0 28px; padding: 5px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); gap: 6px; }
.prediction-modes .admin-subwindow-tab { min-height: 44px; padding: 8px 14px; border-radius: 6px; font-size: 15px; font-weight: 700; line-height: 1.25; border: 1px solid transparent; background: transparent; color: var(--muted); }
.prediction-modes .admin-subwindow-tab[aria-pressed=true] { background: var(--selected-bg); color: var(--selected-text); border-color: var(--selected-bg); }
.admin-view .prediction-modes.admin-subwindow-tabs { display: flex; width: fit-content; max-width: 100%; flex-wrap: wrap; gap: 6px; margin: 18px 0 20px; padding: 5px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.admin-view .prediction-modes .admin-subwindow-tab { flex: 0 1 auto; min-height: 44px; padding: 8px 14px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); font-size: 15px; font-weight: 700; }
.admin-view .prediction-modes .admin-subwindow-tab[aria-pressed=true] { border-color: var(--selected-bg); background: var(--selected-bg); color: var(--selected-text); }
.prediction-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin: 20px 0; padding: 16px 0; border-block: 1px solid var(--line); }
.prediction-metrics div { min-width: 0; }
.prediction-metrics dt { color: var(--muted); font-size: 13px; }
.prediction-metrics dd { margin: 6px 0; font-size: 19px; font-weight: 700; overflow-wrap: anywhere; }
.prediction-metrics small { font-size: 12px; color: var(--muted); }
.prediction-scroll { overflow-x: auto; max-width: 100%; width: 100%; margin: 14px 0; overscroll-behavior-x: contain; }
.prediction-scroll:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.prediction-scroll table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 14px; }
.prediction-scroll caption { text-align: left; padding: 0 0 10px; font-weight: 700; }
.prediction-scroll th { color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; }
.prediction-scroll td, .prediction-scroll th { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; max-width: 250px; overflow-wrap: anywhere; }
.prediction-scroll td:first-child { min-width: 115px; }
.prediction-scroll td { min-width: 95px; overflow-wrap: normal; }
.prediction-scroll button { min-width: max-content; white-space: nowrap; overflow-wrap: normal; }
.prediction-scroll pre, .prediction-fingerprint { overflow-wrap: anywhere; }
.prediction-scroll td small { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); }
.prediction-scroll tbody tr:hover { background: var(--soft); }
.prediction-insights summary { cursor: pointer; padding: 14px 0; font-weight: 650; font-size: 16px; }
.prediction-insights details { min-width: 0; border-bottom: 1px solid var(--line); }
.prediction-note, .prediction-insights p { font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.prediction-warning { border-left: 3px solid var(--orange); padding-left: 12px; color: var(--muted); }
.prediction-empty { padding: 24px 0; }
.prediction-badge { display: inline-block; font-size: 12px; padding: 3px 6px; border-radius: 4px; border: 1px solid var(--line); font-weight: 600; max-width: 100%; }
.prediction-badge.is-active, .prediction-badge.is-measured { color: #d3edc7; background: #315436; border-color: #76a764; }
.prediction-badge.is-testing, .prediction-badge.is-learned { color: #dbf1ff; background: #285261; border-color: #699daa; }
.prediction-badge.is-unknown { color: var(--muted); border-color: var(--orange); }
.prediction-badge.is-disabled, .prediction-badge.is-configured { color: var(--muted); }
.prediction-detail, .prediction-band { margin-top: 28px; padding: 24px 0 0; border-top: 1px solid var(--line); min-width: 0; }
.prediction-detail > label { max-width: 650px; }
.prediction-equation { font-weight: 700; padding: 16px 0; }
.prediction-equation small { display: block; font-weight: 400; color: var(--muted); }
.prediction-status form { display: grid; gap: 12px; max-width: 650px; padding-bottom: 16px; }
.prediction-status button { justify-self: start; }
.prediction-insights pre { white-space: pre-wrap; word-break: break-word; font-size: 12px; margin: 0; }
.prediction-dialog { width: 520px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); overflow: auto; padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); }
.prediction-dialog::backdrop { background: rgba(0,0,0,.55); }
.prediction-dialog form { display: grid; gap: 14px; }
.prediction-dialog .prediction-actions { justify-content: flex-end; }
.prediction-rule-group { padding: 24px 0; border-bottom: 1px solid var(--line); }
.prediction-rule-group header { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.prediction-rule-group header p { margin-top: 0; color: var(--muted); }
.prediction-rule-row { display: grid; grid-template-columns: minmax(180px,2fr) minmax(90px,1fr) minmax(110px,1fr) 90px; align-items: start; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.prediction-rule-row small { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); font-weight: 400; }
.prediction-rule-value { font-size: 22px; }
.prediction-rule-value > small:first-child { margin: 0 0 5px; }
.prediction-rule-row details { border: 0; }
.prediction-rule-row summary { padding: 0; }
.prediction-rule-row > * { min-width: 0; overflow-wrap: anywhere; }
#predictionConnections .admin-edit-block, #predictionRuleExtras .admin-edit-block { border: 0; border-radius: 0; background: transparent; padding: 20px 0; margin: 0; }
#predictionConnections .revo-admin-entry { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
#predictionConnections .revo-admin-entry a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 12px 18px; line-height: 1.3; font-size: 15px; text-align: center; max-width: 100%; }
#predictionConnections .external-source-row, #predictionConnections .external-event-row, #predictionConnections .external-holiday-row { display: grid; grid-template-columns: minmax(160px,1fr) minmax(200px,2fr); gap: 16px; padding: 14px 0; }
#predictionConnections .external-keys { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
#predictionConnections .external-source-controls { display: flex; flex-wrap: wrap; gap: 20px; padding: 16px 0; }
#predictionConnections .external-source-controls label { display: flex; align-items: center; gap: 8px; }
#predictionConnections input[type=checkbox] { width: 22px; height: 22px; min-height: 22px; padding: 0; accent-color: var(--orange); }
#predictionConnections .prediction-year-filter { width: 160px; margin-bottom: 16px; }
.prediction-profile-settings { grid-column: 1 / -1; min-width: 0; }
.prediction-profile-settings .admin-edit-block { border: 0; padding: 0; margin: 0; }
.prediction-profile-settings .forecast-permission-toggle i { pointer-events: none; }
.prediction-profile-settings input[type=time] { min-width: 0; width: 100%; font-size: 15px; padding: 10px; }
.prediction-profile-settings .forecast-schedule-grid { overflow-x: auto; }
.prediction-connection-section { padding: 28px 0; min-width: 0; }
.prediction-connection-section + .prediction-connection-section { border-top: 2px solid var(--line); }
.prediction-connection-section > h3 { margin-bottom: 18px; color: var(--orange); }
#predictionConnections details { border: 0; }
#predictionConnections .prediction-band { margin: 12px 0 0; padding: 0; border: 0; }
#predictionConnections .prediction-band > summary, #predictionConnections #externalSources > summary { padding: 12px 0; }
#predictionConnections .external-source-row, #predictionConnections .external-event-row, #predictionConnections .external-holiday-row { border: 0; }
#predictionConnections .external-source-row:nth-child(even), #predictionConnections .external-event-row:nth-child(even), #predictionConnections .external-holiday-row:nth-child(even) { background: var(--soft); }
#predictionConnections .external-source-row, #predictionConnections .external-event-row, #predictionConnections .external-holiday-row { padding: 14px 12px; }
.prediction-data-status { display: flex; flex-wrap: wrap; gap: 20px 40px; margin: 0 0 12px; }
.prediction-data-status div { min-width: 0; }
.prediction-data-status dt { font-size: 13px; color: var(--muted); }
.prediction-data-status dd { margin: 6px 0 0; font-size: 16px; font-weight: 700; }
#predictionConnections .learning-health-row { border: 0; padding: 8px 0; }
.prediction-event-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 12px 0; }
.prediction-event-filters label { flex: 1 1 170px; }
.prediction-event-filters input, .prediction-event-filters select { width: 100%; }
.prediction-event-pagination { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
#predictionConnections a:not(.primary-button) { color: var(--ink); text-decoration-color: var(--orange); text-underline-offset: 3px; }
#predictionConnections .external-event-row small { display: block; margin-top: 4px; color: var(--muted); }
@media (max-width: 700px) {
  .prediction-rule-row { grid-template-columns: minmax(0,1fr) 105px; gap: 12px; }
  .prediction-rule-row > button { grid-column: 2; }
  #predictionConnections .external-source-row, #predictionConnections .external-event-row, #predictionConnections .external-holiday-row, #predictionConnections .external-keys { grid-template-columns: minmax(0,1fr); gap: 6px; }
  .prediction-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .prediction-insights h2 { font-size: 23px; }
  .prediction-actions { width: 100%; }
  .prediction-actions button { flex: 1 1 140px; }
  .prediction-modes.admin-subwindow-tabs { display: flex; width: 100%; }
  .prediction-modes .admin-subwindow-tab { flex: 1 1 auto; }
  .admin-view .prediction-modes.admin-subwindow-tabs { width: 100%; }
  .admin-view .prediction-modes .admin-subwindow-tab { flex: 1 1 auto; }
  .prediction-filters label { flex: 1 1 150px; }
  .prediction-dialog { padding: 18px; }
}
@media (max-width: 450px) {
  .prediction-filters label { flex-basis: 100%; }
}
.prediction-local-event { display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 280px; }
