/* Active reminders: use the portal palette and keep controls within this workspace. */
#proactive-host {
 --pa-ink: var(--portal-ink, #242424);
 --pa-muted: var(--portal-secondary, #626262);
 --pa-line: var(--portal-border, #e7e7e7);
 --pa-accent: var(--portal-action, #0f6cbd);
 --pa-accent-soft: var(--portal-action-soft, #eaf3fb);
 --pa-surface: var(--portal-surface, #fff);
 --pa-soft: var(--portal-chrome, #fafafa);
 color: var(--pa-ink);
}
#proactive-host :is(button, a, summary, input, select):focus-visible {
 outline: 2px solid var(--pa-accent); outline-offset: 3px;
}
#proactive-host [hidden] { display: none; }
.proactive-toolbar {
 display: flex; align-items: center; justify-content: space-between; gap: 8px 16px;
 border-bottom: 1px solid var(--pa-line); margin-bottom: 22px;
}
.proactive-tabs { display: flex; gap: 16px; align-items: stretch; }
#proactive-host .proactive-tabs button {
 min-height: 48px; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
 padding: 10px 4px; background: transparent; white-space: nowrap; color: var(--pa-muted);
}
#proactive-host .proactive-tabs button[aria-selected=true] {
 color: var(--pa-accent); border-bottom-color: var(--pa-accent); font-weight: 650;
}
#proactive-host .proactive-tabs button:hover { color: var(--pa-accent); }
.proactive-toolbar-state { flex: none; }
.proactive-state, .work-status, .proactive-important {
 display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px;
 font-size: 12px; line-height: 1.5; font-weight: 600; color: #525252; background: #f1f1f1;
}
.proactive-state.is-on, .work-status { color: #216246; background: #e9f5ee; }
.proactive-toolbar-state .proactive-state::before {
 content: ""; width: 6px; height: 6px; background: currentColor; border-radius: 50%;
}
.work-status.limited { color: #69501d; background: #faf2e1; }
.proactive-important { color: #9a3e29; background: #fff1ea; }
.proactive-inbox, .proactive-panel {
 min-width: 0; border: 1px solid var(--pa-line); border-radius: 14px; background: var(--pa-surface);
}
.proactive-inbox-tools {
 display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 14px;
 padding: 12px 16px; border-bottom: 1px solid var(--pa-line);
}
.proactive-filters, .proactive-filter-tools, .proactive-row-actions {
 display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
}
#proactive-host .proactive-filters button {
 min-height: 38px; padding: 5px 10px; border: 1px solid transparent; color: var(--pa-muted);
 background: transparent; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
#proactive-host .proactive-filters button:hover { background: var(--pa-soft); }
#proactive-host .proactive-filters button[aria-pressed=true] {
 color: var(--pa-accent); background: var(--pa-accent-soft); font-weight: 650;
}
.proactive-filter-count {
 min-width: 19px; padding: 1px 4px; box-sizing: border-box; border-radius: 999px;
 background: #00000009; text-align: center; font-size: 11px; line-height: 1.4;
}
.proactive-filter-tools select { width: auto; min-height: 38px; max-width: 100%; margin: 0; font-size: 13px; }
.proactive-filter-tools button, .proactive-more > summary {
 min-width: 38px; min-height: 38px; padding: 0; display: grid; place-items: center;
}
.proactive-row {
 display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
 padding: 17px 16px; border-bottom: 1px solid var(--pa-line);
}
.proactive-row:last-child, .proactive-list .proactive-alert.card:last-child { border-bottom: 0; }
.proactive-alert { min-width: 0; overflow-wrap: anywhere; }
.proactive-list .proactive-alert.card {
 margin: 0; border: 0; border-bottom: 1px solid var(--pa-line); border-radius: 0;
 box-shadow: none; padding: 14px 20px;
}
.proactive-source {
 display: grid; place-items: center; align-self: start; flex: none; width: 38px; height: 38px;
 border-radius: 10px; color: #536579; background: #eef2f7;
}
.proactive-source.is-mail { color: #23649f; background: #eaf3fb; }
.proactive-source.is-calendar { color: #6753a0; background: #f1edfa; }
.proactive-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 9px; color: var(--pa-muted); font-size: 12px; }
.proactive-row-meta small { font-size: inherit; }
.proactive-row h3, .proactive-list .card h3 { margin: 3px 0; }
#proactive-host .proactive-title {
 display: block; max-width: 100%; min-height: 28px; padding: 0; border: 0;
 text-align: left; background: transparent; color: var(--pa-ink);
 font-size: 16px; line-height: 1.5; font-weight: 650; overflow-wrap: anywhere;
}
#proactive-host .proactive-title:hover { color: var(--pa-accent); text-decoration: underline; }
.proactive-row-body p, .proactive-list .card p { margin: 4px 0 0; color: var(--pa-muted); font-size: 13px; line-height: 1.6; }
.proactive-row-body .proactive-hint { font-size: 12px; }
.proactive-row-actions > button {
 display: inline-flex; align-items: center; gap: 5px; min-height: 38px; padding: 5px 10px;
 color: #216246; white-space: nowrap; font-size: 13px;
}
.proactive-row-actions > button svg, .proactive-link svg { width: 16px; height: 16px; flex: none; }
.proactive-more { position: relative; }
.proactive-more > summary { cursor: pointer; list-style: none; border-radius: 8px; color: var(--pa-muted); }
.proactive-more > summary::-webkit-details-marker, .proactive-disclosure > summary::-webkit-details-marker { display: none; }
.proactive-more > summary:hover, .proactive-more[open] > summary { background: var(--pa-soft); }
.proactive-more-items {
 position: absolute; top: calc(100% + 4px); right: 0; z-index: 2;
 display: grid; min-width: 124px; padding: 4px; border: 1px solid var(--pa-line);
 border-radius: 9px; background: var(--pa-surface); box-shadow: 0 6px 18px #0002;
}
#proactive-host .proactive-more-items button {
 min-height: 38px; border: 0; padding: 6px 10px; text-align: left; white-space: nowrap;
}
.proactive-more-items button[data-alert-operation=dismiss] { color: #9a3940; }
.proactive-paging {
 display: flex; justify-content: flex-end; align-items: center; gap: 10px;
 padding: 12px 16px; border-top: 1px solid var(--pa-line); color: var(--pa-muted); font-size: 13px;
}
.proactive-empty { display: grid; justify-items: center; padding: 48px 18px; text-align: center; }
.proactive-empty h2 { margin: 12px 0 4px; font-size: 16px; }
.proactive-empty p { margin: 0; color: var(--pa-muted); }
.proactive-work-summary {
 display: flex; gap: 8px 20px; flex-wrap: wrap; padding: 12px 16px;
 background: var(--pa-soft); color: var(--pa-muted); font-size: 13px;
}
.proactive-work-summary strong { margin-right: 6px; color: var(--pa-ink); }

.proactive-settings-layout {
 display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(250px, 1fr); gap: 16px; align-items: start;
}
.proactive-panel { padding: 20px; }
.proactive-panel-head { margin-bottom: 18px; }
.proactive-panel-head h2, .work-section-heading h2 { margin: 0; font-size: 18px; }
.proactive-panel-head p, .work-section-heading p, .work-service-head p {
 margin: 5px 0 0; font-size: 13px; line-height: 1.6; color: var(--pa-muted);
}
.proactive-setting-toggle {
 display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0;
 padding: 14px; border: 1px solid var(--pa-line); border-radius: 10px; background: var(--pa-soft);
}
.proactive-setting-toggle strong, .proactive-setting-toggle small { display: block; }
.proactive-setting-toggle small { margin-top: 3px; font-size: 13px; color: var(--pa-muted); }
#proactive-host input[role=switch] {
 appearance: none; box-sizing: border-box; flex: none; width: 42px; height: 24px; margin: 0;
 padding: 2px; border: 1px solid #858585; border-radius: 999px; background: #777; cursor: pointer;
}
#proactive-host input[role=switch]::before {
 content: ""; display: block; width: 18px; height: 18px; border-radius: 50%; background: white;
}
#proactive-host input[role=switch]:checked { background: var(--pa-accent); border-color: var(--pa-accent); }
#proactive-host input[role=switch]:checked::before { transform: translateX(18px); }
#proactive-host input[role=switch]:disabled { opacity: .55; cursor: not-allowed; }
@media (forced-colors: active) {
 #proactive-host input[role=switch] { appearance: auto; }
 #proactive-host input[role=switch]::before { content: none; }
}
.proactive-quiet { border: 0; min-width: 0; padding: 0; margin: 18px 0; }
.proactive-quiet legend { padding: 0; font-weight: 650; }
.proactive-quiet p { margin: 4px 0 10px; color: var(--pa-muted); font-size: 13px; }
.proactive-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.proactive-grid label, .work-service form > label:not(.proactive-setting-toggle), [data-alert-snooze-form] label {
 display: grid; gap: 5px; min-width: 0; font-size: 13px;
}
.proactive-grid input, .work-service select, [data-alert-snooze-form] :is(input, select) {
 box-sizing: border-box; width: 100%; min-width: 0; min-height: 40px; margin: 0;
}
.proactive-disclosure { border-top: 1px solid var(--pa-line); }
.proactive-disclosure > summary {
 display: flex; justify-content: space-between; align-items: center; gap: 10px;
 min-height: 42px; padding: 6px 0; cursor: pointer; font-size: 14px; font-weight: 600; list-style: none;
}
.proactive-disclosure > summary::after {
 content: ""; flex: none; width: 7px; height: 7px; border-right: 1.5px solid currentColor;
 border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin: 0 4px 4px;
}
.proactive-disclosure[open] > summary::after { transform: rotate(225deg); margin-bottom: 0; }
.proactive-disclosure-body { display: grid; gap: 12px; padding: 2px 0 12px; }
.proactive-hint { color: var(--pa-muted); font-size: 13px; line-height: 1.6; }
.proactive-disclosure-body p, .proactive-disclosure-body ul { margin: 0; }
.proactive-form-footer { padding-top: 12px; }
.proactive-form-footer button { min-height: 42px; }
.proactive-channels ul { list-style: none; padding: 0; margin: 0 0 12px; }
.proactive-channels li {
 display: flex; justify-content: space-between; gap: 8px; align-items: center;
 min-height: 44px; border-top: 1px solid var(--pa-line); font-size: 14px;
}
.proactive-link {
 display: inline-flex; align-items: center; gap: 5px; min-height: 40px; color: var(--pa-accent);
 font-size: 13px; font-weight: 600; text-decoration: none;
}
.proactive-link:hover { text-decoration: underline; }

.work-section-heading { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-bottom: 14px; }
.work-service-grid { display: grid; gap: 12px; }
.work-service { padding: 14px 18px 6px; overflow-wrap: anywhere; }
.work-service-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding-bottom: 10px; }
.work-service-head h3 { font-size: 16px; margin: 0; }
.work-service-head p { margin-top: 3px; }
.work-service-head .work-status { text-align: center; justify-content: center; }
.work-service-state { display: grid; justify-items: end; gap: 6px; }
.work-service form {
 display: grid; gap: 14px; max-width: 620px; padding-bottom: 14px;
}
.work-service form.work-service-toggle { padding-bottom: 0; }
.work-service-toggle input { margin: 0; }
.work-service fieldset { border: 1px solid var(--pa-line); border-radius: 8px; padding: 10px 12px; margin: 0; min-width: 0; }
.work-service legend { padding: 0 5px; font-size: 13px; font-weight: 650; }
.work-service label.work-check { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 14px; line-height: 1.5; }
.work-service label.work-check + .work-check { margin-top: 8px; }
.work-check input[type=checkbox] { flex: none; width: 17px; height: 17px; margin: 2px 0 0; }
.work-health li { font-size: 13px; line-height: 1.6; }
.work-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.work-limit-note { border-left: 3px solid #c59b19; padding: 8px 12px; background: #fff9e8; color: #694a00; }
.work-coverage, .work-checklist, .work-history { padding-left: 20px; font-size: 14px; line-height: 1.7; }
.work-coverage li { padding: 10px 0; border-bottom: 1px solid var(--pa-line); }
.work-coverage li > div { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.work-coverage p { margin: 6px 0; }
.work-checklist li { padding: 6px 0; }
.work-checklist strong { display: block; }

html:has(.proactive-dialog[open]) { overflow: hidden; }
.proactive-dialog {
 position: fixed; inset: 0; margin: auto; box-sizing: border-box;
 width: min(860px, calc(100% - 24px)); max-width: none; max-height: min(780px, calc(100dvh - 64px));
 overflow: hidden; padding: 0; border: 1px solid var(--pa-line); border-radius: 18px;
 color: var(--pa-ink); background: var(--pa-surface); box-shadow: 0 24px 72px #12233c40;
 overflow-wrap: anywhere;
}
.proactive-dialog[open] { display: flex; flex-direction: column; }
.proactive-dialog::backdrop { background: #18233766; backdrop-filter: blur(2px); }
.proactive-dialog-header {
 flex: none; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 12px;
 padding: 22px 24px 18px; border-bottom: 1px solid var(--pa-line); background: var(--pa-soft);
}
.proactive-dialog-header .proactive-source { width: 44px; height: 44px; border-radius: 12px; }
.proactive-dialog-heading > span { color: var(--pa-muted); font-size: 12px; font-weight: 600; }
.proactive-dialog-heading h2 { margin: 2px 0 0; font-size: 22px; line-height: 1.35; }
#proactive-host .proactive-close {
 display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
 border: 0; border-radius: 10px; color: var(--pa-muted); background: transparent;
}
#proactive-host .proactive-close:hover { color: var(--pa-ink); background: var(--pa-accent-soft); }
.proactive-dialog-body {
 min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable;
 scrollbar-width: thin; scrollbar-color: #8793a1 transparent;
 padding: 20px 24px 22px; font-size: 14px; line-height: 1.6;
}
.proactive-dialog-body h3 { margin: 0 0 4px; font-size: 14px; }
.proactive-dialog-body p { margin: 0; }
.proactive-dialog-body .proactive-dialog-summary { margin-bottom: 14px; color: var(--pa-muted); }
.proactive-dialog-body > .notice { margin-top: 12px; }
.proactive-dialog-body .proactive-disclosure > summary { box-sizing: border-box; min-height: 44px; }
.proactive-dialog-body .proactive-disclosure > summary:hover { color: var(--pa-accent); }
.proactive-next-step {
 display: grid; gap: 12px; padding: 14px 16px; margin-bottom: 16px;
 border-radius: 12px; background: var(--pa-soft);
}
.proactive-next-step p { color: var(--pa-muted); }
.proactive-open-source {
 display: inline-flex; align-items: center; gap: 6px; justify-self: start; min-height: 36px;
 padding: 0 10px; border-radius: 8px; background: var(--pa-accent-soft); color: var(--pa-accent);
 font-size: 13px; font-weight: 600; text-decoration: none;
}
.proactive-open-source:hover { text-decoration: underline; }
.proactive-open-source svg { flex: none; width: 16px; height: 16px; }
.work-detail { margin-bottom: 8px; }
.work-detail > .work-badges { margin: 0 0 12px; }
.work-detail > :is(p,section) { margin: 0 0 12px; }
.work-detail-facts {
 display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 8px; margin: 0 0 14px;
}
.work-detail-facts > div { padding: 8px 12px; border: 1px solid var(--pa-line); border-radius: 10px; }
.work-detail-facts dt { color: var(--pa-muted); font-size: 12px; }
.work-detail-facts dd { margin: 2px 0 0; font-weight: 600; }
.work-detail-sources { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.work-detail-sources a {
 display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 38px;
 padding: 4px 10px; border-radius: 8px; color: var(--pa-accent); background: var(--pa-soft);
 text-decoration: none;
}
.work-detail-sources a:hover { text-decoration: underline; }
.work-detail .work-coverage li:last-child { border-bottom: 0; }
.work-detail .work-coverage small { color: var(--pa-muted); }
.proactive-dialog blockquote {
 margin: 0; padding: 10px 12px; border-inline-start: 3px solid var(--pa-accent);
 border-radius: 4px 8px 8px 4px; background: var(--pa-soft); white-space: pre-wrap;
}
[data-alert-snooze-form] { display: grid; gap: 12px; margin: 6px 0 12px; }
[data-alert-snooze-form] button { justify-self: start; min-height: 42px; }
.proactive-dialog.is-snooze { width: min(440px, calc(100% - 28px)); }
@media (max-width: 1000px) {
 .proactive-settings-layout { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
 .proactive-toolbar { flex-wrap: wrap; gap: 4px 12px; margin-bottom: 14px; }
 .proactive-tabs { gap: 10px; }
 #proactive-host .proactive-tabs button { min-height: 44px; font-size: 13px; }
 .proactive-toolbar-state .proactive-state { font-size: 11px; }
 .proactive-inbox-tools { padding: 10px; }
 .proactive-filters { gap: 3px; }
 #proactive-host .proactive-filters button { font-size: 13px; padding: 5px 6px; }
 .proactive-row { grid-template-columns: auto minmax(0, 1fr); padding: 14px 12px; gap: 7px 10px; }
 .proactive-row-actions { grid-column: 2; }
 .proactive-more-items { right: auto; left: 0; }
 .proactive-panel { padding: 14px; }
 .work-service-head { gap: 8px; grid-template-columns: auto minmax(0, 1fr); }
 .work-service-head .work-status { grid-column: 2; justify-self: start; }
 .work-service-head-toggle { grid-template-columns: auto minmax(0, 1fr) auto; }
 .work-service-state .work-status { grid-column: auto; justify-self: end; }
 .proactive-dialog, .proactive-dialog.is-snooze { width: calc(100% - 24px); max-height: calc(100dvh - 24px); }
 .proactive-dialog-header { padding: 14px; gap: 9px; }
 .proactive-dialog-heading h2 { font-size: 19px; }
 .proactive-dialog-header .proactive-source { width: 36px; height: 36px; }
 .proactive-dialog-body { padding: 14px; }
}
@media (max-width: 360px) {
 .proactive-grid { grid-template-columns: 1fr; }
}
