:root { font-family: system-ui, sans-serif; color: #172033; background: #f5f7fb; }
body { margin: 0; }
header { position: sticky; top: 0; z-index: 100; display: flex; justify-content: space-between; align-items: center; padding: 1rem 2rem; background: #172033; color: white; box-shadow: 0 2px 12px #10182830; }
body.environment-development header, body.environment-test header { background: #b42318; }
body.environment-development .site-menu-content, body.environment-test .site-menu-content { background: #8f1d14; }
header form { display: flex; gap: 1rem; align-items: center; }
header nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
header nav a { color: white; }
.site-menu { margin-left: auto; }
.site-menu > summary { display: none; }
.site-menu-content, details.site-menu:not([open]) > .site-menu-content { display: flex; gap: 1.5rem; align-items: center; }
.burger-icon, .burger-icon::before, .burger-icon::after { display: block; width: 1.25rem; height: 2px; border-radius: 2px; background: currentColor; }
.burger-icon { position: relative; }
.burger-icon::before, .burger-icon::after { position: absolute; left: 0; content: ""; }
.burger-icon::before { top: -.38rem; }
.burger-icon::after { top: .38rem; }
.site-menu[open] .burger-icon { background: transparent; }
.site-menu[open] .burger-icon::before { top: 0; transform: rotate(45deg); }
.site-menu[open] .burger-icon::after { top: 0; transform: rotate(-45deg); }
.notification-button { padding: .25rem 0; background: transparent; color: white; text-decoration: underline; }
.brand { color: white; text-decoration: none; font-weight: 800; }
.header-brand { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.environment-badge { display: inline-flex; align-items: center; min-height: 1.5rem; padding: .18rem .5rem; border: 1px solid #ffffff80; border-radius: 999px; color: white; font-size: .7rem; font-weight: 900; letter-spacing: .08em; }
body.environment-development .environment-badge, body.environment-test .environment-badge { border-color: white; background: white; color: #b42318; }
main { max-width: 1100px; margin: 2rem auto; padding: 0 1rem; }
form { display: grid; gap: 1rem; }
label { display: grid; gap: .35rem; }
input, select, textarea { padding: .75rem; border: 1px solid #cbd2df; border-radius: .5rem; background: white; font: inherit; }
textarea { resize: vertical; }
button { border: 0; border-radius: .5rem; padding: .7rem 1rem; background: #2457d6; color: white; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
button.secondary { background: #485268; }
button.danger { background: #b42318; }
button.dominant { width: 100%; padding: .9rem 1rem; font-size: 1rem; font-weight: 800; box-shadow: 0 3px 10px #b4231840; }
.login-card, .message, .settings-card { background: white; padding: 1.5rem; border-radius: .8rem; box-shadow: 0 2px 12px #17203312; }
.settings-card { max-width: 650px; }
.para-allowlist textarea { min-height: 6rem; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.sync-card { margin-top: 1rem; }
.safety { padding: 1rem; border-radius: .5rem; background: #eef4ff; color: #1849a9; }
.success { padding: 1rem; border-radius: .5rem; background: #d1fadf; color: #05603a; }
.notice { padding: 1rem; border-radius: .5rem; background: #fff4e5; color: #7a2e0e; }
.error-box { padding: 1rem; border-radius: .5rem; background: #fee4e2; color: #b42318; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.stats div { padding: .8rem; border-radius: .5rem; background: #f5f7fb; }
.stats dt { color: #667085; font-size: .85rem; }
.stats dd { margin: .2rem 0 0; font-size: 1.4rem; font-weight: 750; }
label small { color: #667085; }
.login-card { max-width: 420px; margin: 5rem auto; }
.error { color: #b42318; }
.muted { color: #667085; }
.page-heading, .detail-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.page-heading h1, .detail-heading h1 { margin-bottom: .25rem; }
.mail-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.folder-panel, .classification-card, .content-card, .empty-state { background: white; padding: 1.25rem; border-radius: .8rem; box-shadow: 0 2px 12px #17203312; }
.mobile-panel-toggle { display: none; }
.folder-panel-content, details.folder-panel:not([open]) > .folder-panel-content { display: block; }
.filter-panel:not([open]) > .filter-bar { display: grid; }
.folder-panel h2 { margin: 1.25rem .7rem .4rem; color: #667085; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.folder-panel h2:first-child { margin-top: .25rem; }
.folder-nav { display: grid; gap: .15rem; }
.folder-nav a { display: flex; justify-content: space-between; gap: .5rem; padding: .65rem .7rem; border-radius: .5rem; color: #344054; text-decoration: none; }
.folder-nav a:hover { background: #f2f4f7; }
.folder-nav a.active { background: #eef4ff; color: #1849a9; font-weight: 700; }
.folder-nav strong { font-size: .85rem; }
.ticket-section { min-width: 0; }
.filter-bar { display: grid; grid-template-columns: minmax(180px, 1fr) 170px minmax(180px, .8fr) auto auto; gap: .75rem; align-items: end; margin-bottom: .75rem; }
.ticket-filter-bar { grid-template-columns: minmax(180px, 1fr) 150px minmax(160px, .8fr) 170px auto auto; }
.filter-bar label { font-size: .85rem; color: #475467; }
.button-link { display: inline-flex; align-items: center; justify-content: center; padding: .7rem 1rem; border-radius: .5rem; background: #2457d6; color: white; text-decoration: none; }
.button-link.secondary { background: #485268; }
.result-summary { margin: .75rem 0; color: #667085; font-size: .9rem; }
.ticket-list { display: grid; gap: .5rem; }
.ticket-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 160px; gap: 1rem; align-items: center; padding: 1rem; background: white; color: inherit; text-decoration: none; border-radius: .65rem; border: 1px solid transparent; }
.ticket-row:hover { border-color: #9db5f5; box-shadow: 0 2px 12px #17203312; }
.ticket-row.is-new { border-color: #b2ccff; border-left: 5px solid #2457d6; background: #f5f8ff; }
.ticket-row small { display: block; margin-top: .35rem; color: #667085; }
.ticket-row .recipient-warning, .recipient-warning { color: #b42318; font-weight: 750; }
.ticket-copy { min-width: 0; overflow: hidden; }
.ticket-copy > small { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-subject { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.ticket-subject > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.new-badge { flex: 0 0 auto; padding: .18rem .45rem; border-radius: 999px; background: #2457d6; color: white; font-size: .72rem; font-weight: 850; letter-spacing: .03em; text-transform: uppercase; }
.todo-preview { color: #344054 !important; }
.ticket-meta { text-align: right; }
.ticket-meta time { display: block; margin-top: .55rem; color: #1849a9; font-size: .85rem; font-weight: 750; }
.empty-state { text-align: center; padding: 3rem 1.5rem; }
.badge { display: inline-block; padding: .25rem .5rem; border-radius: 999px; font-weight: 700; }
.badge.p1 { background: #fee4e2; color: #b42318; }
.badge.p2 { background: #fef0c7; color: #93370d; }
.badge.p3 { background: #d1fadf; color: #05603a; }
.category-badge { display: inline-block; padding: .25rem .6rem; border-radius: 999px; background: #eef2f6; color: #344054; font-weight: 700; }
.back-link { display: inline-block; margin-bottom: .75rem; }
.detail-badges { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1.4rem; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.25rem; align-items: start; }
.classification-card { position: sticky; top: 1rem; }
.classification-card h2, .content-card h2:first-child { margin-top: 0; }
.classification-card hr { margin: 1.25rem 0; border: 0; border-top: 1px solid #e4e7ec; }
.delete-ticket-form { display: block; }
.checkbox-label { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: .6rem; }
.checkbox-label input { width: 1.1rem; height: 1.1rem; }
.form-help, .message-meta { display: block; margin-top: .65rem; color: #667085; font-size: .85rem; }
.message { margin: 1rem 0; white-space: pre-wrap; }
.message-header-meta { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; padding: .75rem; border-radius: .55rem; background: #f5f7fb; white-space: normal; }
.message-header-meta .message-meta { margin: 0; }
.message-time { flex: 0 0 auto; padding: .4rem .65rem; border-radius: .45rem; background: #dbe8ff; color: #1849a9; font-weight: 800; }
.project-list { display: grid; gap: .8rem; }
.project-workspace-heading { margin: 1.2rem 0 .1rem; color: #344054; }
.project-card { background: #fff; border: 1px solid #d0d5dd; border-radius: .8rem; box-shadow: 0 2px 8px #1018280d; }
.project-card summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.15rem; cursor: pointer; list-style-position: inside; }
.project-summary-main { display: grid; gap: .25rem; }
.project-summary-main small, .project-task small, .project-mail small { color: #667085; }
.project-card-body { padding: 0 1.15rem 1.15rem; border-top: 1px solid #eaecf0; }
.project-next-step { display: grid; gap: .2rem; margin: 1rem 0; padding: .8rem; border-left: 4px solid #2457d6; background: #f5f8ff; }
.project-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.project-facts > div { display: grid; gap: .25rem; padding: .7rem; background: #f8f9fc; border-radius: .55rem; }
.project-facts a { display: block; }
.preline { white-space: pre-line; }
.project-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1rem; align-items: start; }
.project-detail-grid .content-card { margin-bottom: 1rem; }
.project-task, .project-mail { padding: .75rem 0; border-top: 1px solid #eaecf0; }
.project-task:first-of-type, .project-mail:first-of-type { border-top: 0; }
.project-task small, .project-mail small { display: block; margin-top: .2rem; }
@media (max-width: 760px) { .project-facts, .project-detail-grid { grid-template-columns: 1fr; } }
.message-actions { display: flex; flex-wrap: wrap; gap: .65rem; align-items: start; margin-top: 1rem; white-space: normal; }
.message-actions form { display: block; }
.reply-box { flex-basis: 100%; }
.reply-box > summary { width: fit-content; list-style: none; cursor: pointer; }
.reply-box > summary::-webkit-details-marker { display: none; }
.reply-box[open] > summary { margin-bottom: .8rem; }
.reply-box form { display: grid; max-width: 650px; padding: 1rem; border: 1px solid #d0d5dd; border-radius: .6rem; background: #f9fafb; }
.ai-question-box { flex-basis: 100%; }
.ai-question-box > summary { width: fit-content; list-style: none; cursor: pointer; }
.ai-question-box > summary::-webkit-details-marker { display: none; }
.ai-question-box[open] > summary { margin-bottom: .8rem; }
.ai-question-box form { display: grid; gap: .7rem; max-width: 700px; padding: 1rem; border: 1px solid #b8c7ee; border-radius: .6rem; background: #f5f8ff; }
.ai-answer { margin-top: 1rem; padding: 1rem; border: 1px solid #b8c7ee; border-left: 4px solid #2457d6; border-radius: .6rem; background: #f8faff; white-space: normal; }
.ai-answer-heading { display: flex; justify-content: space-between; gap: 1rem; }
.ai-answer-heading small { color: #667085; }

/* Mailboxes */
.mailbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1.25rem 0; }
.mailbox-card { padding: 1.25rem; border-radius: .8rem; background: white; box-shadow: 0 2px 12px #17203312; border: 1px solid #e4e7ec; }
.mailbox-card.inactive { opacity: .7; }
.card-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.card-heading > div > strong, .card-heading > div > small { display: block; }
.card-heading small { margin: .3rem 0 0 1.1rem; color: #667085; overflow-wrap: anywhere; }
.status-dot { display: inline-block; width: .65rem; height: .65rem; margin-right: .45rem; border-radius: 50%; }
.status-dot.online { background: #12b76a; box-shadow: 0 0 0 4px #d1fadf; }
.status-dot.paused { background: #98a2b3; }
.profile-pill { flex: 0 0 auto; padding: .3rem .55rem; border-radius: 999px; background: #eef4ff; color: #1849a9; font-size: .8rem; font-weight: 750; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 1rem 0; }
.mini-stats div { padding: .65rem; border-radius: .5rem; background: #f5f7fb; }
.mini-stats dt { color: #667085; font-size: .75rem; }
.mini-stats dd { margin: .15rem 0 0; font-size: 1.25rem; font-weight: 800; }
.ai-usage { padding-top: .85rem; border-top: 1px solid #e4e7ec; }
.ai-usage h3 { margin: 0 0 .65rem; font-size: .9rem; }
.ai-usage small { display: block; margin-top: .55rem; color: #667085; font-size: .75rem; }
.usage-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem; margin: 0; }
.usage-stats div { min-width: 0; padding: .5rem; border-radius: .45rem; background: #f8fafc; }
.usage-stats dt { color: #667085; font-size: .68rem; }
.usage-stats dd { margin: .12rem 0 0; overflow-wrap: anywhere; font-size: .95rem; font-weight: 800; }
.usage-note { margin: -.35rem 0 1rem; font-size: .78rem; }
.check-time { color: #667085; font-size: .85rem; }
.inline-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.inline-actions form { display: block; }
.mailbox-form-card { margin-top: 1rem; }
.form-columns { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 1rem; }
.form-wide { grid-column: 1 / -1; }

/* Operations dashboard */
.ops-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.ops-heading h1 { margin: .15rem 0; font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.04em; }
.ops-heading p { margin: 0; color: #667085; }
.eyebrow { color: #2457d6; font-size: .78rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.ops-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.ops-kpis article { position: relative; overflow: hidden; padding: 1rem 1.1rem; border-radius: .75rem; background: #172033; color: white; }
.ops-kpis article::after { content: ""; position: absolute; right: -1rem; bottom: -2rem; width: 5rem; height: 5rem; border-radius: 50%; background: #ffffff10; }
.ops-kpis article.critical { background: #7a271a; }
.ops-kpis article.urgent { background: #93370d; }
.ops-kpis span, .ops-kpis strong { display: block; }
.ops-kpis span { color: #d0d5dd; font-size: .82rem; }
.ops-kpis strong { margin-top: .3rem; font-size: 2rem; }
.server-values, .original-mail-card { margin-bottom: 1rem; padding: 1.15rem; border-radius: .8rem; background: white; box-shadow: 0 2px 12px #17203312; }
.server-values h2, .original-mail-card h2 { margin: .15rem 0 .25rem; }
.server-values > div > p, .original-mail-card > div > p { margin: 0; color: #667085; }
.server-values-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: .7rem; margin-top: 1rem; }
.server-values-grid article { padding: .85rem; border: 1px solid #e4e7ec; border-radius: .65rem; background: #fbfcfe; }
.server-values-grid span, .server-values-grid strong, .server-values-grid small { display: block; }
.server-values-grid span { color: #475467; font-size: .82rem; font-weight: 750; }
.server-values-grid strong { margin: .2rem 0; color: #172033; font-size: 1.8rem; }
.server-values-grid small { color: #667085; }
.server-values-grid h3 { margin: 0 0 .15rem; }
.resource-list { display: grid; gap: .55rem; margin: .8rem 0 0; }
.resource-list > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .1rem .5rem; padding-top: .55rem; border-top: 1px solid #e4e7ec; }
.resource-list dt { color: #475467; font-size: .78rem; font-weight: 750; }
.resource-list dd { margin: 0; color: #172033; font-weight: 850; }
.resource-list small { grid-column: 1 / -1; }
.local-resource-card { display: grid; gap: 1rem; margin-bottom: 1rem; padding: 1.15rem; border: 1px solid #d0d5dd; border-radius: .8rem; background: white; box-shadow: 0 2px 12px #17203312; }
.local-resource-card.severity-warning { border-color: #f79009; }
.local-resource-card.severity-critical { border-color: #d92d20; background: #fff8f7; }
.local-resource-card h2 { margin: .15rem 0 .25rem; }
.local-resource-card > div > p { margin: 0; color: #667085; }
.local-resource-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.local-resource-grid article { display: grid; gap: .25rem; padding: .85rem; border: 1px solid #e4e7ec; border-radius: .65rem; background: #fbfcfe; }
.local-resource-grid span { color: #475467; font-size: .82rem; font-weight: 750; }
.local-resource-grid strong { margin: .2rem 0; color: #172033; font-size: 1.8rem; }
.local-resource-grid small { color: #667085; }
.resource-status { margin: 0; color: #475467; }
.resource-status-warning { color: #b54708; }
.resource-status-critical { color: #b42318; }
@media (max-width: 800px) { .local-resource-grid { grid-template-columns: 1fr; } }
.original-mail-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.original-mail-actions form { display: block; }
button.danger { background: #b42318; }
.timeline-overview { margin-bottom: 1rem; padding: 1.15rem; border-radius: .8rem; background: white; box-shadow: 0 2px 12px #17203312; }
.timeline-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin-bottom: 1rem; }
.timeline-heading h2 { margin: .15rem 0 .25rem; }
.timeline-heading p { margin: 0; color: #667085; }
.timeline-range { display: block; min-width: 130px; }
.timeline-range label { color: #475467; font-size: .82rem; }
.timeline-range select { width: 100%; }
.timeline-grid { display: grid; gap: 1rem; }
.timeline-server { min-width: 0; padding: 1rem; border: 1px solid #e4e7ec; border-radius: .7rem; background: #fbfcfe; }
.timeline-overall { border-color: #b2c6ff; background: #f5f8ff; }
.timeline-server-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.timeline-server-heading h3 { margin: 0; }
.timeline-server-heading span { display: block; margin-top: .2rem; color: #667085; font-size: .82rem; overflow-wrap: anywhere; }
.timeline-server-heading > strong { flex: 0 0 auto; padding: .3rem .55rem; border-radius: 999px; background: #eef4ff; color: #1849a9; font-size: .78rem; }
.timeline-legend { display: flex; flex-wrap: wrap; gap: .4rem .75rem; margin: .85rem 0 .25rem; }
.timeline-legend button { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .45rem; border: 1px solid transparent; background: transparent; color: #344054; font-size: .76rem; text-align: left; }
.timeline-legend button::before { width: .7rem; height: .7rem; border-radius: 50%; background: var(--series-color); content: ""; }
.timeline-legend button[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.timeline-legend button:focus-visible { outline: 2px solid #2457d6; outline-offset: 1px; }
.timeline-chart-wrap { position: relative; min-height: 230px; }
.timeline-chart { display: block; width: 100%; height: 230px; overflow: visible; touch-action: pan-y; }
.timeline-gridline { stroke: #e4e7ec; stroke-width: 1; }
.timeline-axis-label { fill: #667085; font-size: 11px; }
.timeline-line { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.timeline-point { stroke: white; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.timeline-guide { stroke: #98a2b3; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.timeline-tooltip { position: absolute; z-index: 2; width: max-content; max-width: min(260px, calc(100% - 1rem)); padding: .6rem .7rem; border-radius: .55rem; background: #172033; color: white; box-shadow: 0 6px 18px #10182838; pointer-events: none; font-size: .75rem; }
.timeline-tooltip strong { display: block; margin-bottom: .3rem; }
.timeline-tooltip span { display: flex; justify-content: space-between; gap: 1rem; margin-top: .2rem; }
.timeline-tooltip i { display: inline-block; width: .55rem; height: .55rem; margin-right: .35rem; border-radius: 50%; background: var(--series-color); }
.timeline-empty { padding: 2rem 1rem; border: 1px dashed #cbd2df; border-radius: .7rem; color: #667085; text-align: center; }
.event-groups { padding: 1rem; border: 1px solid #e4e7ec; border-radius: .7rem; background: #fbfcfe; }
.event-groups > h3, .server-charts-title { margin: 0 0 .7rem; }
.event-group { border-top: 1px solid #e4e7ec; border-left: 4px solid #98a2b3; background: white; }
.event-group.severity-critical { border-left-color: #d92d20; }
.event-group.severity-warning { border-left-color: #f79009; }
.event-group.severity-ok { border-left-color: #12b76a; }
.event-group summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .65rem; align-items: center; padding: .7rem; cursor: pointer; }
.event-group summary > i { width: .75rem; height: .75rem; border-radius: 50%; background: var(--series-color); }
.event-group summary span, .event-group summary small { display: block; }
.event-group summary small { margin-top: .15rem; color: #667085; font-weight: 500; }
.event-group summary > b { color: #1849a9; }
.event-sources { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .35rem; padding: 0 .7rem .7rem 2rem; }
.event-sources a { display: flex; justify-content: space-between; gap: .5rem; padding: .5rem; border-radius: .45rem; background: #f2f4f7; color: #344054; text-decoration: none; }
.event-sources span, .event-sources small { display: block; min-width: 0; overflow-wrap: anywhere; }
.event-sources small { margin-top: .1rem; color: #667085; font-size: .72rem; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.ops-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1rem; align-items: start; }
.report-filters { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(170px, 1.2fr) 130px 130px auto; gap: .65rem; align-items: end; padding: .8rem; margin-bottom: .8rem; border-radius: .7rem; background: white; box-shadow: 0 2px 12px #17203312; }
.report-filters label { color: #475467; font-size: .82rem; }
.incident-list { display: grid; gap: .7rem; }
.incident-card { overflow: hidden; border: 1px solid #e4e7ec; border-left: 5px solid #98a2b3; border-radius: .75rem; background: white; box-shadow: 0 2px 12px #1720330d; }
.incident-card.severity-critical, .report-detail-heading.severity-critical { border-left-color: #d92d20; }
.incident-card.severity-warning, .report-detail-heading.severity-warning { border-left-color: #f79009; }
.incident-card.severity-ok, .report-detail-heading.severity-ok { border-left-color: #12b76a; }
.incident-topline { display: flex; align-items: center; gap: .5rem; padding: .65rem 1rem; background: #f9fafb; color: #667085; font-size: .78rem; font-weight: 700; }
.severity-label, .urgency-label, .risk, .confirmation { display: inline-block; padding: .22rem .48rem; border-radius: 999px; font-size: .75rem; font-weight: 850; }
.severity-label { background: #fee4e2; color: #b42318; }
.urgency-label { background: #fef0c7; color: #93370d; }
.severity-label.severity-warning { background: #fef0c7; color: #93370d; }
.severity-label.severity-ok { background: #d1fadf; color: #05603a; }
.severity-label.severity-unknown { background: #eef2f6; color: #344054; }
.urgency-label.urgency-info { background: #eef2f6; color: #344054; }
.urgency-label.urgency-later { background: #eef4ff; color: #1849a9; }
.incident-body { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 1rem; padding: 1rem; }
.incident-body h2 { margin: .25rem 0 .4rem; }
.incident-body h2 a { color: #172033; text-decoration: none; }
.incident-body p { margin: .4rem 0; }
.source-name { color: #2457d6; font-size: .8rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.cause-preview { color: #475467; font-size: .9rem; }
.incident-meta { display: grid; align-content: start; gap: .5rem; color: #667085; font-size: .82rem; }
.incident-meta strong { color: #344054; }
.incident-actions { display: flex; gap: .5rem; padding: 0 1rem 1rem; }
.incident-actions form { display: block; }
.ops-sidebar { display: grid; gap: 1rem; }
.chart-card, .source-card, .analysis-card { padding: 1.15rem; border-radius: .75rem; background: white; box-shadow: 0 2px 12px #17203312; }
.chart-card h2, .source-card h2, .analysis-card h2 { margin-top: 0; }
.bar-row { display: grid; grid-template-columns: 65px minmax(0, 1fr) 24px; gap: .5rem; align-items: center; margin: .75rem 0; font-size: .8rem; }
.bar-track { height: .5rem; overflow: hidden; border-radius: 999px; background: #eaecf0; }
.bar-track i { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: #98a2b3; }
.bar-track .bar-critical { background: #d92d20; }.bar-track .bar-warning { background: #f79009; }.bar-track .bar-ok { background: #12b76a; }
.source-card details { border-top: 1px solid #eaecf0; }
.source-card summary { display: flex; justify-content: space-between; gap: .5rem; padding: .8rem 0; cursor: pointer; }
.source-card summary span, .source-card summary small { display: block; }
.source-card summary small { margin-top: .2rem; color: #667085; overflow-wrap: anywhere; }
.source-card details form { padding-bottom: 1rem; }
.report-types-card a { display: flex; justify-content: space-between; gap: .75rem; padding: .65rem 0; border-top: 1px solid #eaecf0; color: #344054; text-decoration: none; font-size: .82rem; }
.report-types-card a span { min-width: 0; overflow-wrap: anywhere; }
.report-types-card a strong { flex: 0 0 auto; color: #1849a9; }

/* Server report detail */
.report-detail-heading { display: flex; justify-content: space-between; gap: 1rem; padding: 1.25rem; margin-bottom: 1rem; border-left: 6px solid #98a2b3; border-radius: .8rem; background: #172033; color: white; }
.report-detail-heading h1 { margin: .2rem 0; }
.report-detail-heading p { margin-bottom: 0; color: #d0d5dd; }
.report-state { display: flex; flex-direction: column; align-items: end; gap: .45rem; min-width: 120px; }
.report-state small { color: #d0d5dd; }
.report-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 1rem; align-items: start; }
.report-detail-grid main, .report-detail-grid aside { display: grid; gap: 1rem; }
.analysis-card h2:not(:first-child) { margin-top: 1.5rem; }
.steps-card li { margin-bottom: .65rem; padding-left: .25rem; }
.command-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .65rem; padding: 1rem 0; border-top: 1px solid #eaecf0; }
.command-row pre { grid-column: 1 / -1; max-width: 100%; overflow-x: auto; margin: 0; padding: .85rem; border-radius: .55rem; background: #101828; color: #e6edf7; white-space: pre-wrap; overflow-wrap: anywhere; }
.command-row p { margin: .5rem 0 0; }
.risk-low { background: #d1fadf; color: #05603a; }.risk-medium { background: #fef0c7; color: #93370d; }.risk-high { background: #fee4e2; color: #b42318; }
.confirmation { margin-left: .35rem; background: #eef2f6; color: #344054; }
.security-warning { padding: .22rem .48rem; border-radius: 999px; background: #7a271a; color: white; font-size: .75rem; font-weight: 850; }
.facts-card dl { margin: 0; }.facts-card dt { margin-top: .8rem; color: #667085; font-size: .78rem; }.facts-card dd { margin: .2rem 0 0; overflow-wrap: anywhere; }
.history-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; align-items: center; border-top: 1px solid #eaecf0; }
.history-row > a { display: flex; justify-content: space-between; gap: .5rem; padding: .65rem 0; color: #344054; text-decoration: none; font-size: .82rem; }
.history-row form { display: block; }
.history-row > small { color: #667085; font-size: .72rem; }
button.compact { padding: .35rem .5rem; font-size: .72rem; }
.history-card .history-pagination { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .75rem; }
.history-card .history-pagination a { display: inline-flex; padding: .5rem .65rem; border: 0; color: white; }
.history-pagination span { color: #667085; font-size: .78rem; text-align: center; }
.facts-card .history-switch { display: inline-block; margin-top: 1rem; color: #1849a9; font-size: .85rem; font-weight: 750; }

/* Relationship reminders */
.relationship-heading { margin-bottom: 1.25rem; }
.relationship-heading h1 { margin: .2rem 0; font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.04em; }
.relationship-heading p, .section-heading p, .relationship-settings p { margin: .25rem 0 0; color: #667085; }
.relationship-settings { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr); gap: 1rem; align-items: start; padding: 1.15rem; border-radius: .8rem; background: #eef4ff; }
.relationship-settings h2, .section-heading h2 { margin: .15rem 0; }
.category-toggles { display: grid; gap: .55rem; }
.category-toggles form { display: flex; justify-content: space-between; gap: .75rem; align-items: center; padding: .65rem; border-radius: .55rem; background: white; }
.category-toggles span, .category-toggles small { display: block; }
.category-toggles small { margin-top: .15rem; color: #667085; }
.relationship-section { margin-top: 1.5rem; }
.section-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: start; margin-bottom: .8rem; }
.relationship-selection-heading { align-items: end; }
.contact-display-limit { display: flex; align-items: end; gap: .45rem; flex: 0 0 auto; }
.contact-display-limit label { color: #475467; font-size: .8rem; font-weight: 700; }
.contact-display-limit select { min-width: 4rem; }
.contact-display-limit button { white-space: nowrap; }
.count-badge { min-width: 1.6rem; padding: .3rem .45rem; border-radius: 999px; background: #2457d6; color: white; text-align: center; }
.relationship-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.relationship-card { display: grid; gap: .9rem; padding: 1rem; border: 1px solid #e4e7ec; border-radius: .8rem; background: white; box-shadow: 0 2px 12px #1720330d; }
.relationship-card.due-card { border-color: #b2c6ff; border-left: 5px solid #2457d6; background: linear-gradient(135deg, #fff 70%, #eef4ff); }
.relationship-card p { margin: 0; color: #475467; }
.relationship-person { display: flex; gap: .75rem; align-items: center; min-width: 0; }
.relationship-person h3 { margin: 0 0 .2rem; }
.relationship-person span:not(.avatar) { display: block; color: #667085; font-size: .78rem; overflow-wrap: anywhere; }
.avatar { display: grid; flex: 0 0 2.65rem; width: 2.65rem; height: 2.65rem; place-items: center; border-radius: 50%; background: #dbe7ff; color: #1849a9; font-weight: 850; }
.muted-avatar { background: #f2f4f7; color: #475467; }
.relationship-actions { display: grid; gap: .55rem; }
.relationship-actions .button-link { text-align: center; }
.relationship-actions form { display: flex; flex-wrap: wrap; gap: .4rem; }
.relationship-actions form button { flex: 1 1 130px; }
.contact-config { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) auto; align-items: end; gap: .55rem; }
.relationship-list { display: grid; gap: .5rem; }
.relationship-list > article { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(360px, 1.4fr) auto; gap: .6rem; align-items: center; padding: .8rem; border-radius: .65rem; background: white; box-shadow: 0 2px 12px #1720330d; }
.relationship-list strong, .relationship-list small { display: block; }
.relationship-list small { margin-top: .2rem; color: #667085; overflow-wrap: anywhere; }
.inline-config { grid-template-columns: minmax(130px, 1fr) 85px auto; }
.relationship-list > article > form:last-child { display: block; }

/* Address book and calendar */
.contact-heading { align-items: end; }
.contact-filter { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(220px, .8fr) auto; gap: .7rem; align-items: end; margin: 1rem 0; padding: 1rem; border-radius: .8rem; background: #eef4ff; }
.contact-list-heading { display: flex; justify-content: space-between; gap: 1rem; margin: 1.15rem 0 .55rem; font-size: .9rem; }
.contact-list-labels { display: grid; grid-template-columns: 2.75rem minmax(190px, 1.2fr) minmax(160px, .9fr) minmax(130px, .7fr) auto; gap: .8rem; padding: 0 1rem .35rem; color: #667085; font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.contact-list-labels span:first-child { grid-column: 2; }
.contact-list-labels span:nth-child(2) { grid-column: 3; }
.contact-list-labels span:nth-child(3) { grid-column: 4; }
.contact-list { display: grid; gap: .75rem; }
.contact-card-row { display: grid; gap: .7rem; min-width: 0; padding: .9rem 1rem; border: 1px solid #e4e7ec; border-radius: .9rem; background: white; box-shadow: 0 3px 16px #17203310; }
.contact-row-main { display: grid; grid-template-columns: 2.75rem minmax(150px, 1.4fr) minmax(120px, .8fr) minmax(160px, 1fr) auto; gap: .8rem; align-items: center; min-width: 0; color: inherit; text-decoration: none; }
.contact-row-main:hover, .contact-row-main:focus-visible { color: #1849a9; outline: none; }
.contact-card-row:has(.contact-row-main:focus-visible), .contact-card-row:has(.contact-row-main:hover) { border-color: #9db5f5; box-shadow: 0 6px 20px #2457d625; }
.contact-identity, .contact-account, .contact-activity { display: block; min-width: 0; }
.contact-identity strong, .contact-identity small, .contact-account small, .contact-account span, .contact-activity small, .contact-activity span, .contact-activity em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-identity strong { font-size: 1rem; }
.contact-identity small, .contact-account small, .contact-activity small { margin-top: .2rem; color: #667085; font-size: .78rem; }
.contact-account span, .contact-activity span { margin-top: .2rem; color: #344054; font-size: .84rem; }
.contact-activity em { margin-top: .18rem; color: #2457d6; font-size: .75rem; font-style: normal; }
.contact-row-main .contact-avatar { flex: 0 0 auto; }
.contact-row-main .contact-row-arrow { color: #2457d6; font-size: 1.5rem; line-height: 1; }
.contact-actions { display: flex; flex-wrap: wrap; gap: .4rem; padding-left: 3.55rem; }
.contact-action { display: inline-flex; align-items: center; justify-content: center; gap: .25rem; min-width: 3.1rem; padding: .42rem .6rem; border: 1px solid #cbd2df; border-radius: .45rem; background: #f9fafb; color: #2457d6; font-size: .78rem; font-weight: 750; text-decoration: none; }
.contact-action:hover, .contact-action:focus-visible { border-color: #2457d6; background: #eef4ff; outline: none; }
.contact-action-details { margin-left: auto; }
.contact-avatar { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: #dbe8ff; color: #1849a9; font-weight: 850; }
.contact-avatar-large { width: 4rem; height: 4rem; font-size: 1.25rem; }
.contact-list-main, .contact-list-phone, .contact-list-meta { min-width: 0; }
.contact-list-main strong, .contact-list-main small, .contact-list-main > span, .contact-list-phone span, .contact-list-phone small, .contact-list-meta span, .contact-list-meta small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-list-main strong { font-size: 1rem; }
.contact-list-main > span, .contact-list-phone span { overflow-wrap: anywhere; white-space: normal; }
.contact-list-main small, .contact-list-phone small, .contact-list-meta small { margin-top: .24rem; color: #667085; font-size: .8rem; }
.contact-list-main > span { margin-top: .28rem; color: #2457d6; font-size: .85rem; }
.contact-list-phone { color: #344054; font-size: .85rem; }
.contact-list-meta { text-align: left; color: #475467; font-size: .8rem; }
.contact-row-arrow { color: #2457d6; font-size: 1.5rem; line-height: 1; }
.contact-detail-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 1.25rem; margin-bottom: 1rem; border-radius: .8rem; background: white; box-shadow: 0 2px 12px #17203312; }
.contact-detail-identity { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.contact-detail-identity h1 { margin: .2rem 0 .25rem; }
.contact-detail-identity p { margin: 0; }
.contact-subtitle { color: #475467; }
.contact-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .65fr); gap: 1rem; align-items: start; }
.contact-detail-grid main, .contact-detail-grid aside { display: grid; gap: 1rem; }
.contact-card { padding: 1.1rem 1.25rem; }
.contact-card h2 { margin-top: 0; font-size: 1.05rem; }
.contact-fields { display: grid; gap: .7rem; margin: 0; }
.contact-fields > div { display: grid; grid-template-columns: minmax(125px, .6fr) minmax(0, 1.4fr); gap: .8rem; padding-top: .65rem; border-top: 1px solid #eaecf0; }
.contact-fields > div:first-child { padding-top: 0; border-top: 0; }
.contact-fields dt { color: #667085; font-size: .82rem; }
.contact-fields dd { margin: 0; overflow-wrap: anywhere; }
.contact-fields a { color: #2457d6; }
.contact-note { margin: 0; white-space: pre-wrap; color: #344054; }
.contact-edit-form { display: grid; gap: 1rem; }
.contact-edit-form .form-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.research-links { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0 1rem; }
.research-links .button-link { padding: .55rem .75rem; font-size: .85rem; }
.contact-table-wrap { overflow-x: auto; border-radius: .8rem; background: white; box-shadow: 0 2px 12px #1720330d; }
.contact-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.contact-table th, .contact-table td { padding: .85rem 1rem; border-bottom: 1px solid #eaecf0; text-align: left; vertical-align: top; }
.contact-table th { color: #667085; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.contact-table td strong, .contact-table td a, .contact-table td small { display: block; }
.contact-table td a { margin-top: .2rem; color: #2457d6; overflow-wrap: anywhere; }
.contact-table td small { margin-top: .25rem; color: #667085; }
.calendar-list { display: grid; gap: .8rem; }
.calendar-card { display: grid; grid-template-columns: 6rem minmax(0, 1fr) minmax(220px, .55fr); gap: 1rem; padding: 1rem; border: 1px solid #e4e7ec; border-left: 5px solid #f79009; border-radius: .8rem; background: white; box-shadow: 0 2px 12px #1720330d; }
.calendar-card.confirmed { border-left-color: #12b76a; }
.calendar-card.changed { border-left-color: #2457d6; }
.calendar-date { display: grid; align-content: start; gap: .2rem; color: #1849a9; }
.calendar-date strong { font-size: 1.5rem; }
.calendar-date span { font-weight: 700; }
.calendar-meta { display: flex; flex-wrap: wrap; gap: .45rem; color: #667085; font-size: .78rem; }
.status-pill { padding: .2rem .45rem; border-radius: 999px; background: #fef0c7; color: #93370d; font-weight: 800; }
.calendar-card.confirmed .status-pill { background: #d1fadf; color: #05603a; }
.calendar-copy h2 { margin: .35rem 0 .45rem; }
.calendar-copy p { margin: .25rem 0; }
.calendar-description { color: #475467; }
.calendar-contacts { margin: .65rem 0; }
.calendar-contacts > strong { color: #475467; font-size: .82rem; }
.calendar-contacts ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .45rem; padding: 0; margin: .4rem 0 0; list-style: none; }
.calendar-contacts li { min-width: 0; }
.calendar-contacts a { display: block; padding: .5rem .6rem; border: 1px solid #e4e7ec; border-radius: .55rem; background: #f9fafb; color: #344054; text-decoration: none; }
.calendar-contacts a:hover, .calendar-contacts a:focus-visible { border-color: #9db5f5; background: #eef4ff; }
.calendar-contacts a strong, .calendar-contacts a small, .calendar-contacts a span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-contacts a small { margin-top: .15rem; color: #667085; }
.calendar-contacts a span { margin-top: .2rem; color: #2457d6; font-size: .78rem; }
.calendar-new-form { display: grid; gap: 1rem; }
.calendar-form-card { padding: 1.15rem 1.25rem; }
.calendar-form-card h2 { margin-top: 0; }
.calendar-form-card .section-heading { margin-bottom: .8rem; }
.calendar-form-card .section-heading h2 { margin-bottom: .2rem; }
.calendar-form-card .section-heading p { margin: 0; }
.contact-picker-filters { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(210px, .6fr); gap: .7rem; margin-bottom: .8rem; }
.contact-picker-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: .5rem; max-height: 28rem; overflow-y: auto; padding: .15rem; }
.contact-picker-row { display: flex; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: .65rem; padding: .65rem; border: 1px solid #e4e7ec; border-radius: .6rem; background: #fff; cursor: pointer; }
.contact-picker-row:hover, .contact-picker-row:has(input:checked) { border-color: #9db5f5; background: #eef4ff; }
.contact-picker-row input { flex: 0 0 auto; width: 1.1rem; height: 1.1rem; margin-top: .15rem; accent-color: #2457d6; }
.contact-picker-copy { min-width: 0; }
.contact-picker-copy strong, .contact-picker-copy small, .contact-picker-copy > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-picker-copy small { margin-top: .15rem; color: #475467; }
.contact-picker-copy > span { margin-top: .2rem; color: #2457d6; font-size: .8rem; }
.contact-picker-empty { margin: .7rem 0 0; }
.calendar-actions { display: grid; gap: .5rem; align-content: start; }
.calendar-actions form { display: block; }
.calendar-change { display: grid; gap: .4rem; padding: .65rem; border-radius: .55rem; background: #f9fafb; }
.calendar-change button { width: 100%; }
.sync-info { margin: 1rem 0; padding: .85rem 1rem; border: 1px solid #d0d5dd; border-radius: .7rem; background: #f9fafb; }
.sync-info summary { cursor: pointer; font-weight: 800; color: #1849a9; }
.sync-info p { margin: .65rem 0 0; color: #475467; }
.sync-info code { display: inline-block; max-width: 100%; overflow-wrap: anywhere; color: #172033; }

@media (max-width: 800px) {
  header { position: sticky; top: 0; padding: .8rem 1rem; gap: .7rem; }
  .site-menu { position: relative; width: auto; margin-left: auto; }
  .site-menu > summary { display: flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; padding: 0; border: 1px solid #667085; border-radius: .5rem; cursor: pointer; list-style: none; }
  .site-menu > summary:focus-visible { outline: 3px solid #84adff; outline-offset: 2px; }
  .menu-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .site-menu > summary::-webkit-details-marker, .mobile-panel-toggle::-webkit-details-marker { display: none; }
  .site-menu-content { position: absolute; z-index: 20; top: calc(100% + .55rem); right: 0; display: grid; width: min(19rem, calc(100vw - 2rem)); gap: .75rem; padding: .65rem; border: 1px solid #344054; border-radius: .7rem; background: #172033; box-shadow: 0 12px 28px #10182845; }
  details.site-menu:not([open]) > .site-menu-content { display: none; }
  header nav { display: grid; gap: 0; }
  header nav a, header .notification-button { padding: .7rem .8rem; border-bottom: 1px solid #344054; text-align: left; }
  header form { justify-content: space-between; padding: .25rem .8rem; border-top: 1px solid #344054; }
  main { margin-top: 1rem; }
  .mail-layout, .detail-grid, .ops-layout, .report-detail-grid, .relationship-settings, .relationship-grid, .contact-filter, .calendar-card { grid-template-columns: 1fr; }
  .folder-panel { position: static; padding: 0; }
  .mobile-panel-toggle { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1rem; cursor: pointer; list-style: none; }
  .mobile-panel-toggle::after { content: "+"; margin-left: auto; color: #2457d6; font-size: 1.35rem; line-height: 1; }
  details[open] > .mobile-panel-toggle::after { content: "−"; }
  .mobile-panel-toggle > strong { color: #1849a9; font-size: .85rem; }
  .folder-panel-content { padding: 0 .55rem .8rem; }
  details.folder-panel:not([open]) > .folder-panel-content, details.filter-panel:not([open]) > .filter-bar { display: none; }
  .filter-panel { margin-bottom: .75rem; border-radius: .8rem; background: white; box-shadow: 0 2px 12px #17203312; }
  .filter-panel .filter-bar { padding: 0 1rem 1rem; margin-bottom: 0; }
  .folder-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-bar, .report-filters { grid-template-columns: 1fr 1fr; }
  .ticket-row { grid-template-columns: 1fr; gap: .55rem; }
  .ticket-meta { text-align: left; }
  .classification-card { position: static; }
  .message-header-meta { display: block; }
  .message-time { display: inline-block; margin-top: .65rem; }
  .mailbox-grid { grid-template-columns: 1fr; }
  .ops-kpis { grid-template-columns: 1fr 1fr; }
  .timeline-heading { align-items: start; }
  .incident-body { grid-template-columns: 1fr; }
  .relationship-list > article { grid-template-columns: 1fr; }
  .calendar-date { display: flex; gap: .6rem; align-items: baseline; }
  .contact-row-main { grid-template-columns: 2.75rem minmax(0, 1fr) auto; }
  .contact-list-labels { display: none; }
  .contact-account, .contact-activity { grid-column: 2 / -1; }
  .contact-actions { padding-left: 0; }
  .contact-detail-heading { align-items: start; flex-direction: column; }
}

@media (max-width: 520px) {
  .filter-bar, .folder-nav, .report-filters, .form-columns, .ops-kpis { grid-template-columns: 1fr; }
  .usage-stats { grid-template-columns: 1fr 1fr; }
  .detail-heading { display: block; }
  .ops-heading, .report-detail-heading { display: block; }
  .timeline-heading, .timeline-server-heading { display: block; }
  .relationship-selection-heading { display: block; }
  .contact-display-limit { margin-top: .8rem; }
  .timeline-range { margin-top: .8rem; }
  .timeline-server-heading > strong { display: inline-block; margin-top: .55rem; }
  .timeline-server { padding: .75rem .55rem; }
  .report-state { align-items: start; margin-top: 1rem; }
  .contact-config, .inline-config { grid-template-columns: 1fr; }
  .contact-heading { display: block; }
  .contact-fields > div { grid-template-columns: 1fr; gap: .2rem; }
  .contact-detail-identity { align-items: flex-start; }
}

/* Persistent application header and refreshed address-book layout */
.has-site-header { padding-top: 4.5rem; }
header { position: fixed; inset: 0 0 auto; z-index: 1000; }
.contact-heading { padding: 1.25rem 1.4rem; border: 1px solid #dbe5f7; border-radius: 1rem; background: linear-gradient(135deg, #eef4ff, #f8fbff); }
.contact-heading h1 { margin-top: .2rem; font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.04em; }
.contact-heading p { max-width: 42rem; }
.contact-heading .inline-actions { justify-content: flex-end; }
.contact-heading .button-link { box-shadow: 0 2px 7px #17203318; }
.contact-filter { border: 1px solid #dbe5f7; background: white; box-shadow: 0 3px 16px #1720330d; }
.contact-filter button { min-height: 2.85rem; font-weight: 800; }
.contact-list-heading { align-items: baseline; padding: 0 .2rem; }
.contact-list { gap: .85rem; }
.contact-card-row { overflow: hidden; padding: 0; border-radius: 1rem; box-shadow: 0 4px 18px #17203312; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.contact-card-row:hover { transform: translateY(-1px); }
.contact-row-main { padding: 1.05rem 1.15rem .95rem; }
.contact-identity strong { color: #172033; font-size: 1.05rem; }
.contact-identity small { overflow-wrap: anywhere; white-space: normal; }
.contact-account, .contact-activity { padding: .45rem .6rem; border-radius: .55rem; background: #f8fafc; }
.contact-account small, .contact-activity small { margin-top: 0; font-weight: 750; letter-spacing: .02em; }
.contact-account span, .contact-activity span { overflow-wrap: anywhere; white-space: normal; }
.contact-actions { align-items: center; min-height: 2.8rem; padding: .7rem 1.15rem .8rem 4.7rem; border-top: 1px solid #eaecf0; background: #f8fafc; }
.contact-action { min-height: 2rem; background: white; box-shadow: 0 1px 2px #17203310; }
.contact-action-details { margin-left: auto; background: #2457d6; color: white; border-color: #2457d6; }
.contact-action-details:hover, .contact-action-details:focus-visible { background: #1849a9; color: white; }

@media (max-width: 800px) {
  .has-site-header { padding-top: 4.25rem; }
  header { position: fixed; inset: 0 0 auto; }
  .contact-heading { padding: 1rem; }
  .contact-heading .inline-actions { justify-content: stretch; }
  .contact-heading .inline-actions .button-link { flex: 1 1 100%; }
  .contact-row-main { padding: 1rem; }
  .contact-account, .contact-activity { grid-column: 2 / -1; }
  .contact-actions { padding: .7rem 1rem .85rem; }
  .contact-action-details { margin-left: 0; }
}
/* PARA workspace */
.secretary-tasks { margin-bottom: 1.25rem; }
.task-list { display: grid; gap: .65rem; }
.task-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: .8rem; border: 1px solid #e4e7ec; border-radius: .6rem; background: #fcfcfd; }
.task-row strong, .task-row small, .task-row p { display: block; }
.task-row small { color: #667085; margin-top: .2rem; }
.task-row p { margin: .45rem 0; color: #475467; }
.task-row form { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 700px) { .task-row { flex-direction: column; } .task-row form { justify-content: flex-start; } }
.workspace-heading { align-items: flex-end; }
.workspace-tabs { display: flex; gap: .65rem; margin: 1.25rem 0; flex-wrap: wrap; }
.workspace-tabs a { display: flex; gap: .65rem; align-items: center; padding: .7rem 1rem; border: 1px solid var(--border, #d7dce5); border-radius: .75rem; text-decoration: none; color: inherit; background: var(--surface, #fff); }
.workspace-tabs a.active { border-color: #2457d6; box-shadow: inset 0 0 0 1px #2457d6; }
.workspace-tabs strong { min-width: 1.6rem; text-align: center; }
.workspace-list { display: grid; gap: .85rem; }
.workspace-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, 26rem); gap: 1.25rem; padding: 1.1rem; border: 1px solid var(--border, #d7dce5); border-radius: 1rem; background: var(--surface, #fff); }
.workspace-item h2 { margin: .35rem 0; font-size: 1.1rem; }
.workspace-item h2 a { color: inherit; }
.workspace-item p { margin: .4rem 0; }
.workspace-meta { display: flex; gap: .75rem; flex-wrap: wrap; color: var(--muted, #667085); font-size: .8rem; }
.workspace-assign { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; align-content: start; }
.workspace-assign button, .workspace-assign small { grid-column: 1 / -1; }
.workspace-assigned { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: .3rem; }

/* Shopping list */
.shopping-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 1rem; align-items: start; }
.shopping-card { padding: 1.15rem; }
.shopping-card h2 { margin-top: 0; }
.shopping-items { display: grid; gap: .6rem; }
.shopping-item { display: grid; grid-template-columns: 2.35rem minmax(0, 1fr) auto; gap: .75rem; align-items: center; padding: .7rem; border: 1px solid #e4e7ec; border-radius: .7rem; background: #fbfcfe; }
.shopping-item.is-checked { background: #f8fafc; }
.shopping-toggle, .shopping-delete { display: block; }
.shopping-check { display: grid; place-items: center; width: 2rem; height: 2rem; padding: 0; border: 2px solid #98a2b3; border-radius: 50%; background: white; color: white; font-weight: 900; }
.is-checked .shopping-check { border-color: #12b76a; background: #12b76a; }
.shopping-copy { min-width: 0; }
.shopping-copy strong, .shopping-copy span, .shopping-copy small { display: block; }
.shopping-copy span, .shopping-copy small { margin-top: .2rem; color: #667085; font-size: .8rem; }
.is-checked .shopping-copy strong { color: #667085; text-decoration: line-through; }
.shopping-delete button { padding: .5rem .7rem; }
.shopping-form { gap: .65rem; }
@media (max-width: 800px) { .shopping-layout { grid-template-columns: 1fr; } }

/* Personal occasions and gift memory */
.occasion-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 1rem; align-items: start; }
.occasion-sidebar { display: grid; gap: 1rem; }
.occasion-card { padding: 1.15rem; margin-bottom: 1rem; }
.occasion-card h2 { margin-top: 0; }
.occasion-card .section-heading h2 { margin-bottom: .2rem; }
.occasion-list, .gift-history { display: grid; gap: .65rem; }
.occasion-row { display: grid; grid-template-columns: 5.2rem minmax(0, 1fr) minmax(13rem, 18rem); gap: .9rem; align-items: start; padding: .85rem; border: 1px solid #e4e7ec; border-radius: .7rem; background: #fbfcfe; }
.occasion-row.occasion-soon { border-color: #f5c26b; background: #fffaf0; }
.occasion-date { display: grid; gap: .15rem; padding: .5rem; border-radius: .55rem; background: #eef4ff; color: #1849a9; text-align: center; }
.occasion-date strong { font-size: 1.3rem; }
.occasion-date span { font-size: .72rem; font-weight: 800; }
.occasion-meta { display: flex; flex-wrap: wrap; gap: .45rem; color: #667085; font-size: .78rem; }
.occasion-meta b { color: #b54708; }
.occasion-copy h3 { margin: .2rem 0; }
.occasion-copy p, .occasion-copy small { margin: .2rem 0 0; color: #667085; }
.occasion-actions { display: grid; gap: .45rem; }
.occasion-actions form, .occasion-form { display: grid; gap: .5rem; }
.occasion-actions input { min-width: 0; }
.occasion-form small { color: #667085; font-size: .75rem; }
.gift-suggestions { padding: .75rem 0; border-top: 1px solid #eaecf0; }
.gift-suggestions h3 { margin: 0 0 .55rem; }
.gift-suggestion-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .55rem; }
.gift-suggestion-grid article { display: grid; gap: .45rem; padding: .7rem; border: 1px solid #dbe5f7; border-radius: .6rem; background: #f8fbff; }
.gift-suggestion-grid small, .gift-history span, .gift-history small { color: #667085; font-size: .78rem; }
.gift-history article { display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, 1fr); gap: .8rem; padding: .75rem 0; border-top: 1px solid #eaecf0; }
.gift-history article > div { display: grid; gap: .2rem; align-content: start; }
.gift-history form { display: grid; grid-template-columns: 7rem minmax(0, 1fr) auto; gap: .5rem; align-items: end; }
.gift-history form label { font-size: .78rem; }
@media (max-width: 900px) { .occasion-layout { grid-template-columns: 1fr; } .occasion-row { grid-template-columns: 4.7rem minmax(0, 1fr); } .occasion-actions { grid-column: 1 / -1; } .gift-history article, .gift-history form { grid-template-columns: 1fr; } }
@media (max-width: 800px) {
  .workspace-item { grid-template-columns: 1fr; }
  .workspace-assign { grid-template-columns: 1fr; }
  .workspace-assigned { align-items: flex-start; }
}

/* App shell and mobile overflow guard */
:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #eef2f7;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 0; max-width: 100%; overflow-x: clip; }
body { min-width: 0; max-width: 100%; overflow-x: hidden; background: #eef2f7; }
body.has-site-header { background: linear-gradient(180deg, #e9eef7 0, #f5f7fb 18rem, #f5f7fb 100%); }

header {
  width: 100%;
  min-width: 0;
  padding: .85rem clamp(1rem, 3vw, 2rem);
  background: rgba(18, 29, 49, .97);
  box-shadow: 0 8px 24px rgba(16, 24, 40, .18);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  min-width: 0;
  letter-spacing: -.02em;
}
.brand::before {
  display: inline-block;
  width: 1.85rem;
  height: 1.85rem;
  border: 2px solid #8eb2ff;
  border-radius: .55rem;
  background: linear-gradient(135deg, #3970f6, #6c5ce7);
  box-shadow: inset 0 0 0 4px #172033;
  content: "";
}
.site-menu-content { min-width: 0; }
header nav a { text-decoration: none; }
header nav a:hover, header nav a:focus-visible { color: #bcd0ff; }

main {
  width: 100%;
  min-width: 0;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.6rem clamp(1rem, 3vw, 2rem) 3rem;
}

h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { letter-spacing: -.025em; }
button, .button-link { min-height: 2.75rem; border-radius: .65rem; font-weight: 700; }
button:hover, .button-link:hover { filter: brightness(.97); }
input, select, textarea { min-width: 0; max-width: 100%; border-color: #c9d2e1; border-radius: .65rem; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(82, 126, 235, .28);
  outline-offset: 2px;
}

.page-heading, .contact-heading, .relationship-heading { margin-bottom: 1.35rem; }
.page-heading h1, .detail-heading h1 { margin-top: .15rem; font-size: clamp(1.8rem, 4vw, 2.55rem); }
.page-heading p { max-width: 48rem; line-height: 1.55; }
.content-card, .folder-panel, .classification-card, .empty-state, .message,
.settings-card, .mailbox-card, .server-values, .original-mail-card,
.timeline-overview, .local-resource-card, .chart-card, .source-card,
.analysis-card, .contact-detail-heading, .contact-card, .calendar-form-card,
.shopping-card, .occasion-card, .relationship-card, .workspace-item,
.task-row { border: 1px solid rgba(201, 210, 225, .92); box-shadow: 0 8px 24px rgba(23, 32, 51, .07); }

.message, .preline, .ai-answer, .project-card-body, .workspace-mail-copy { overflow-wrap: anywhere; }
.detail-heading, .ops-heading, .relationship-heading, .contact-heading, .workspace-heading { min-width: 0; }
.detail-heading > div, .page-heading > div, .workspace-mail-copy { min-width: 0; }
.ticket-section, .detail-grid > section, .detail-grid > aside, .ops-main, .ops-sidebar,
.report-detail-grid > main, .report-detail-grid > aside, .shopping-layout > *, .occasion-layout > * { min-width: 0; }

@media (max-width: 800px) {
  header { padding-top: .75rem; padding-bottom: .75rem; }
  .site-menu { flex: 0 0 auto; }
  .site-menu-content {
    position: fixed;
    top: calc(4.1rem + env(safe-area-inset-top));
    right: max(1rem, env(safe-area-inset-right));
    width: min(19rem, calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
  }
  main { padding-top: 1.25rem; padding-bottom: 2rem; }
  .page-heading, .detail-heading, .ops-heading, .relationship-heading, .contact-heading, .workspace-heading { gap: .75rem; }
  .page-heading h1, .detail-heading h1 { font-size: clamp(1.7rem, 8vw, 2.2rem); }
  .workspace-heading p, .contact-heading p { line-height: 1.45; }
}

@media (max-width: 520px) {
  header { gap: .5rem; }
  .brand { font-size: 1rem; }
  .brand::before { width: 1.65rem; height: 1.65rem; }
  .site-menu > summary { width: 2.9rem; height: 2.9rem; border-radius: .65rem; }
  .site-menu-content { top: calc(3.85rem + env(safe-area-inset-top)); }
  .content-card, .folder-panel, .classification-card, .empty-state, .message,
  .settings-card, .mailbox-card, .server-values, .original-mail-card,
  .timeline-overview, .local-resource-card, .chart-card, .source-card,
  .analysis-card, .contact-detail-heading, .calendar-form-card, .shopping-card,
  .occasion-card { padding: 1rem; }
}

/* Connection and error states */
.connection-status {
  position: fixed;
  top: max(4.5rem, env(safe-area-inset-top));
  right: clamp(1rem, 3vw, 2rem);
  left: clamp(1rem, 3vw, 2rem);
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: .8rem;
  max-width: 720px;
  margin: 0 auto;
  padding: .8rem 1rem;
  border: 1px solid #f2b8b5;
  border-radius: .8rem;
  background: #fff8f7;
  color: #7a271a;
  box-shadow: 0 12px 32px rgba(16, 24, 40, .16);
}
.connection-status[hidden] { display: none; }
.connection-status-mark { display: grid; flex: 0 0 1.65rem; width: 1.65rem; height: 1.65rem; place-items: center; border-radius: 50%; background: #d92d20; color: white; font-weight: 850; }
.connection-status div { display: grid; min-width: 0; gap: .1rem; }
.connection-status strong { font-size: .9rem; }
.connection-status div span { color: #93370d; font-size: .82rem; }
.connection-retry { flex: 0 0 auto; margin-left: auto; padding: .5rem .7rem; background: #7a271a; font-size: .82rem; }
.status-page { max-width: 640px; margin: clamp(3rem, 12vh, 8rem) auto; padding: clamp(1.5rem, 5vw, 3rem); border: 1px solid #cbd6ea; border-radius: 1.25rem; background: rgba(255, 255, 255, .9); text-align: center; box-shadow: 0 16px 40px rgba(23, 32, 51, .1); }
.status-code { margin-bottom: .5rem; color: #3459e6; font-size: clamp(3rem, 12vw, 6rem); font-weight: 900; letter-spacing: -.09em; line-height: .9; }
.status-page h1 { margin: .5rem 0 .75rem; font-size: clamp(1.7rem, 5vw, 2.5rem); }
.status-page p { max-width: 34rem; margin: 0 auto; color: #475467; line-height: 1.6; }
.status-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: .6rem; margin-top: 1.5rem; }

@media (max-width: 520px) {
  .connection-status { align-items: flex-start; flex-wrap: wrap; top: 4rem; padding: .75rem; }
  .connection-status div { flex: 1 1 calc(100% - 2.5rem); }
  .connection-retry { flex: 1 1 100%; margin: .2rem 0 0 2.45rem; }
  .status-page { margin-top: 2.5rem; }
  .status-actions > * { flex: 1 1 100%; }
}
