:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #697386;
  --line: #e5e9f0;
  --surface: #fff;
  --surface-soft: #f8f9fc;
  --surface-subtle: #fafbfd;
  --surface-hover: #fbfcfe;
  --canvas: #f4f7fb;
  --field-border: #d7deea;
  --card-border: #e8ecf3;
  --track: #e8edf2;
  --navy: #080653;
  --blue: #1717b8;
  --green: #159a69;
  --red: #d64d5f;
  --amber: #c88616;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
.history-progress-bar { position: fixed; inset: 0 0 auto; height: 5px; z-index: 1000; overflow: hidden; pointer-events: none; background: #a9a9ff40; }
.history-progress-bar span { display: block; width: 35%; height: 100%; background: linear-gradient(90deg, #a9a9ff, #38d9ef); box-shadow: 0 0 10px #38d9ef88; animation: history-progress-slide 1.5s ease-in-out infinite; }
@keyframes history-progress-slide { from { transform: translateX(-100%); } to { transform: translateX(286%); } }
@media (prefers-reduced-motion: reduce) { .history-progress-bar span { animation: none; width: 100%; } }
button, input { font: inherit; }
button { cursor: pointer; }
.topbar { min-height: 190px; padding: 34px max(24px, calc((100vw - 1420px) / 2)); background: linear-gradient(120deg, #06033f, #11118d); color: #fff; display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.topbar h1 { margin: 5px 0 4px; font-size: clamp(1.7rem, 3vw, 2.35rem); letter-spacing: -.04em; }
.topbar p { margin: 0; color: #c9c9f4; }
.dashboard-brand { display: flex; align-items: center; gap: 20px; }
.dashboard-logo { width: 112px; height: 66px; object-fit: contain; padding: 6px; border-radius: 12px; background: #fff; box-shadow: 0 8px 24px #02012266; }
.eyebrow { color: #a9a9ff; font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.login-mode .dashboard-brand, .login-mode .topbar-actions { display: none; }
.login-mode .topbar { min-height: 190px; }
.dashboard-mode .login-panel { display: none !important; }
.account-label { color: #d4d4f5; font-size: .85rem; margin-right: 6px; }
.session-countdown { padding: 7px 10px; border: 1px solid #ffffff2b; border-radius: 8px; color: #dce7f8; background: #ffffff0d; font-size: .78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.session-countdown-expiring { color: #ffd69b; border-color: #e6a94c66; background: #e6a94c18; }
.theme-toggle { min-height: 40px; padding: 7px 10px; border: 1px solid #ffffff38; border-radius: 9px; color: #fff; background: #ffffff14; display: inline-flex; align-items: center; gap: 7px; transition: .16s ease; }
.theme-toggle:hover { border-color: #ffffff66; background: #ffffff22; transform: translateY(-1px); }
.theme-toggle:focus-visible { outline: 3px solid #ffffff52; outline-offset: 2px; }
.theme-icon { width: 15px; line-height: 1; color: #aeb3dc; font-size: .9rem; text-align: center; transition: color .2s ease; }
.theme-icon-sun { color: #ffe18a; }
.theme-toggle-track { position: relative; width: 34px; height: 18px; border-radius: 20px; background: #ffffff35; box-shadow: inset 0 0 0 1px #ffffff21; transition: background .2s ease; }
.theme-toggle-thumb { position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px #02012270; transition: transform .2s ease; }
[data-theme="dark"] .theme-toggle-thumb { transform: translateX(16px); }
[data-theme="dark"] .theme-icon-sun { color: #aeb3dc; }
[data-theme="dark"] .theme-icon-moon { color: #dce3ff; }
main { width: min(1420px, calc(100% - 48px)); margin: -44px auto 50px; }
.login-panel { display: grid; place-items: start center; }
.login-card { width: min(440px, 100%); padding: 32px; background: var(--surface); border-radius: 18px; box-shadow: 0 18px 45px #17233c24; display: grid; gap: 16px; }
.login-logo { width: 130px; height: auto; margin: 0 auto 4px; }
.login-card .eyebrow { color: var(--blue); }
.login-card h2 { margin: 0; font-size: 1.5rem; }
.login-card p { margin: -6px 0 4px; color: var(--muted); line-height: 1.55; }
.login-card label { display: grid; gap: 7px; font-size: .86rem; font-weight: 700; }
input { width: 100%; border: 1px solid var(--field-border); border-radius: 10px; padding: 11px 13px; color: var(--ink); background: var(--surface); outline: none; }
input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #1717b824; }
.button { border: 0; border-radius: 9px; padding: 10px 15px; font-weight: 750; transition: .16s ease; }
.topbar .status-page-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 40px; padding: 10px 15px; color: #fff; border: 1px solid #ffffff38; border-radius: 9px; background: #ffffff14; text-decoration: none; font-weight: 750; box-shadow: inset 0 1px 0 #ffffff12; }
.topbar .status-page-button:hover { color: #fff; border-color: #ffffff66; background: #ffffff22; transform: translateY(-1px); }
.status-live-dot { position: relative; width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: #39d98a; box-shadow: 0 0 0 3px #39d98a2b; }
.status-live-dot::after { content: ""; position: absolute; inset: -4px; border: 2px solid #39d98a; border-radius: 50%; animation: status-pulse 1.8s ease-out infinite; }
@keyframes status-pulse { 0% { opacity: .8; transform: scale(.6); } 75%, 100% { opacity: 0; transform: scale(1.45); } }
.button:disabled { cursor: wait; opacity: .65; }
.button-primary { color: #fff; background: var(--blue); }
.button-secondary { color: var(--navy); background: #fff; }
.button-ghost { color: #dce7f8; background: #ffffff12; border: 1px solid #ffffff2b; }
.button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(.98); }
.refresh-button { width: 40px; min-height: 40px; padding: 8px; display: inline-flex; align-items: center; justify-content: center; }
.refresh-icon { display: block; }
.refresh-button.is-refreshing .refresh-icon { animation: spin .75s linear infinite; }
.form-success { margin: -2px 0 0 !important; padding: 10px 12px; border: 1px solid #62bf983d; border-radius: 9px; color: #0f7a53 !important; background: #eaf8f2; font-size: .84rem; line-height: 1.4 !important; }
.form-success:empty { display: none; }
.form-error { color: var(--red) !important; min-height: 1.25em; font-size: .86rem; }
.login-loading { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: #070447c9; backdrop-filter: blur(5px); }
.login-loading-card { width: min(330px, 100%); padding: 28px 24px; border: 1px solid #ffffff29; border-radius: 16px; color: #fff; background: #100d75; box-shadow: 0 22px 55px #02011c70; text-align: center; }
.login-loading-card strong, .login-loading-card small { display: block; }
.login-loading-card strong { margin: 17px 0 6px; font-size: 1.08rem; }
.login-loading-card small { color: #c9c9ef; line-height: 1.45; }
.login-loading-spinner { display: block; width: 42px; height: 42px; margin: 0 auto; border: 4px solid #ffffff38; border-top-color: #fff; border-radius: 50%; animation: spin .75s linear infinite; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.metric-card { position: relative; min-height: 170px; padding: 22px; background: var(--surface); border: 1px solid var(--card-border); border-radius: 15px; box-shadow: 0 8px 22px #1524420b; overflow: hidden; }
.metric-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: #2222c9; }
.metric-card > span { display: block; color: var(--muted); font-size: .8rem; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.metric-card strong { display: block; margin: 11px 0 6px; font-size: 2.25rem; letter-spacing: -.04em; }
.metric-card small { color: var(--muted); }
.metric-card .metric-period { display: block; margin-top: 7px; font-size: .7rem; line-height: 1.35; }
.metric-blocked::before { background: var(--red); }
.metric-accepted::before { background: var(--green); }
.metric-delivery::before { background: var(--blue); }
.delivery-track { height: 7px; margin: 4px 0 10px; border-radius: 10px; background: var(--track); overflow: hidden; }
.delivery-track span { display: block; height: 100%; width: 0; background: var(--green); transition: width .45s ease; }
.rates-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 14px; }
.rate-row { min-width: 0; padding: 11px 10px 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.rate-heading { display: grid; gap: 4px; }
.rate-heading small { color: var(--muted); font-size: .7rem; font-weight: 700; }
.metric-card .rate-heading strong { margin: 0; font-size: 1.15rem; line-height: 1; letter-spacing: -.02em; }
.rate-row .delivery-track { height: 5px; margin: 9px 0 0; }
.blocked-track span { background: var(--red); }
.table-card { position: relative; background: var(--surface); border: 1px solid var(--card-border); border-radius: 16px; overflow: hidden; box-shadow: 0 8px 24px #1524420c; }
.table-toolbar { padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.table-toolbar h2 { margin: 0 0 4px; font-size: 1.1rem; }
.table-toolbar p { margin: 0; color: var(--muted); font-size: .84rem; }
.table-controls { width: min(790px, 100%); display: grid; justify-items: end; gap: 10px; }
.search-actions { width: 100%; display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.search-actions input { max-width: 380px; }
.metrics-button { min-height: 42px; padding: 9px 13px; border: 1px solid var(--line); color: var(--navy); background: var(--surface-soft); display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.status-filters { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.filter-chip { position: relative; cursor: pointer; }
.filter-chip input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.filter-chip span { display: inline-flex; align-items: center; gap: 6px; min-height: 31px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 18px; color: var(--muted); background: var(--surface); font-size: .72rem; font-weight: 750; transition: .15s ease; }
.filter-chip span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #aab2c0; }
.filter-chip input:focus-visible + span { outline: 3px solid #1717b824; outline-offset: 2px; }
.filter-chip input:checked + span { color: var(--navy); border-color: #bfc5e9; background: #f1f1ff; }
.filter-accepted input:checked + span::before { background: var(--green); }
.filter-blocked input:checked + span::before { background: var(--red); }
.filter-flag input:checked + span::before { background: var(--amber); }
.filter-grey input:checked + span::before { background: #718096; }
.filter-hold input:checked + span::before { background: #a85f18; }
.filter-inexistent input:checked + span::before { background: #8e4db7; }
.table-scroll { overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; scrollbar-color: #b9c0d3 #f0f2f7; scrollbar-width: thin; }
.table-scroll::-webkit-scrollbar { height: 8px; }
.table-scroll::-webkit-scrollbar-track { background: #f0f2f7; }
.table-scroll::-webkit-scrollbar-thumb { border-radius: 8px; background: #b9c0d3; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 15px; color: var(--muted); background: var(--surface-subtle); font-size: .72rem; text-align: left; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
td { max-width: 310px; padding: 15px; border-top: 1px solid var(--line); vertical-align: top; font-size: .84rem; line-height: 1.45; }
tbody tr:hover { background: var(--surface-hover); }
.primary-text { color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
.secondary-text { margin-top: 3px; color: var(--muted); font-size: .77rem; overflow-wrap: anywhere; }
.subject-text { color: var(--ink); font-weight: 400; overflow-wrap: anywhere; }
.date-cell { white-space: nowrap; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 20px; font-size: .73rem; font-weight: 800; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-accepted { color: #087a50; background: #e5f7ef; }
.status-blocked { color: #b02d43; background: #fdecef; }
.status-flag { color: #946308; background: #fff3d2; }
.status-greylisting { color: #596579; background: #edf0f4; }
.status-hold { color: #98500d; background: #fff0db; }
.status-inexistent { color: #77369d; background: #f4e9fb; }
.status-other { color: #8a630e; background: #fff6de; }
.menu-wrap { position: relative; }
.menu-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); font-size: 1.2rem; line-height: 1; }
.action-menu { position: absolute; z-index: 5; top: 38px; right: 0; min-width: 145px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 12px 28px #19243b22; }
.action-menu button { width: 100%; padding: 9px 10px; border: 0; border-radius: 7px; background: transparent; text-align: left; font-weight: 700; font-size: .8rem; }
.action-menu button:hover { background: var(--surface-soft); }
.action-menu .danger { color: var(--red); }
.request-state { min-width: 132px; margin-top: 8px; }
.request-track { height: 4px; border-radius: 5px; background: var(--track); overflow: hidden; }
.request-track span { display: block; height: 100%; width: 35%; background: #2222c9; animation: loading 1s ease-in-out infinite alternate; }
.request-result { font-size: .72rem; font-weight: 750; }
.request-success { color: var(--green); }
.request-error { color: var(--red); }
@keyframes loading { to { transform: translateX(190%); } }
.alert { margin: 14px 20px 0; padding: 11px 13px; border-radius: 9px; color: #9c2c40; background: #ffedf0; font-size: .84rem; }
.empty-state { padding: 45px 20px; color: var(--muted); text-align: center; }
.table-loading { position: absolute; z-index: 10; inset: 81px 0 0; min-height: 260px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--navy); background: #f9fbfdee; backdrop-filter: blur(2px); }
.loading-spinner { width: 24px; height: 24px; border: 3px solid #d8dcf1; border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pagination { min-height: 68px; padding: 14px 20px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 12px; }
.pagination button { min-width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--surface); font-weight: 750; }
.pagination button:hover:not(:disabled) { color: #fff; border-color: var(--blue); background: var(--blue); }
.pagination button:disabled { cursor: default; opacity: .45; }
.pagination .page-active { color: #fff; border-color: var(--blue); background: var(--blue); }
.pagination-nav { padding: 0 13px; }
.page-numbers { display: flex; align-items: center; gap: 6px; }
.page-ellipsis { min-width: 26px; color: var(--muted); text-align: center; }
.page-status { display: none; color: var(--muted); font-size: .8rem; }
.toast-region { position: fixed; z-index: 20; right: 22px; bottom: 22px; display: grid; gap: 8px; }
.toast { max-width: 370px; padding: 12px 15px; border-radius: 10px; color: #fff; background: #1d2b43; box-shadow: 0 10px 25px #15203632; font-size: .84rem; }
.toast-error { background: #a93649; }
.site-footer { width: min(1420px, calc(100% - 48px)); margin: -25px auto 24px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); }
.site-footer small { font-size: .7rem; }
.footer-heart { color: var(--red); font-size: .82rem; }
.footer-alerts-button { padding: 0; border: 0; color: var(--blue); background: transparent; font: inherit; font-size: .8rem; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.service-alerts-modal { width: min(640px, calc(100% - 24px)); max-height: calc(100dvh - 32px); padding: 0; overflow-y: auto; border: 1px solid var(--card-border); border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: 0 26px 70px #0000004a; }
.service-alerts-modal::backdrop { background: #070b16bd; backdrop-filter: blur(5px); }
.service-alerts-modal[open] { display: flex; flex-direction: column; overflow: hidden; }
.service-alerts-modal > .modal-header, .service-alerts-modal > .service-alerts-footer { flex-shrink: 0; }
html:has(.service-alerts-modal[open]) { overflow: hidden; }
.service-alerts-modal .modal-header { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.service-alerts-modal .modal-header p { line-height: 1.5; }
.service-alerts-body { padding: 24px; min-height: 0; overflow-y: auto; }
.service-alerts-messages { display: grid; gap: 14px; }
.service-alerts-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.service-alerts-toolbar p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.service-alerts-toolbar button { flex-shrink: 0; background: var(--surface-soft); color: var(--blue); border: 1px solid var(--line); font-size: .78rem; }
.service-alert-message { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); overflow-wrap: anywhere; }
.service-alert-message time, .service-alert-message small { display: block; color: var(--muted); font-size: .78rem; }
.service-alert-message p { margin: 12px 0; white-space: pre-wrap; font-size: .9rem; line-height: 1.65; }
.service-alert-message a { display: inline-block; margin-top: 12px; color: var(--blue); font-size: .8rem; font-weight: 650; }
.service-alerts-notice { padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.service-alerts-icon { color: var(--blue); }
.service-alerts-notice h3 { margin: 12px 0 8px; font-size: 1.05rem; }
.service-alerts-notice p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.65; }
.service-alerts-subscribe { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 20px; padding: 13px 16px; text-decoration: none; text-align: center; line-height: 1.5; }
.service-alerts-footer { padding: 20px 24px 24px; border-top: 1px solid var(--line); }
.service-alerts-preference { display: flex; align-items: flex-start; gap: 10px; font-size: .86rem; line-height: 1.5; cursor: pointer; }
.service-alerts-preference input { flex: 0 0 18px; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--blue); }
.service-alerts-preference-status { color: var(--muted); font-size: .8rem; line-height: 1.5; }
.service-alerts-preference-status:empty { display: none; }
.service-alerts-continue { width: 100%; margin-top: 18px; border: 1px solid var(--line); background: var(--surface-soft); color: var(--ink); }
.service-alerts-modal :focus-visible, .footer-alerts-button:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
@media (max-width: 540px) {
  .service-alerts-modal .modal-header, .service-alerts-body, .service-alerts-footer { padding: 18px 16px; }
  .service-alerts-notice { padding: 18px; }
  .service-alerts-toolbar { flex-direction: column; }
}
.support-widget { position: fixed; z-index: 60; right: 18px; bottom: 24px; }
.support-button { width: 54px; height: 54px; padding: 0; border: 1px solid #ffffff42; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #1717b8, #080653); box-shadow: 0 12px 30px #08065352; display: grid; place-items: center; transition: transform .16s ease, box-shadow .16s ease; }
.support-button:hover { transform: translateY(-2px); box-shadow: 0 16px 34px #08065368; }
.support-button:focus-visible { outline: 3px solid #1717b83d; outline-offset: 3px; }
.support-panel { position: absolute; right: 66px; bottom: 0; width: min(320px, calc(100vw - 104px)); border: 1px solid var(--card-border); border-radius: 15px; color: var(--ink); background: var(--surface); box-shadow: 0 18px 48px #07112636; overflow: hidden; }
.support-panel-header { padding: 17px 18px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.support-panel-header .eyebrow { color: var(--blue); }
.support-panel-header h2 { margin: 4px 0 0; font-size: 1.15rem; }
.support-close { width: 32px; height: 32px; flex: 0 0 32px; padding: 0; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--surface-soft); font-size: 1.3rem; line-height: 1; }
.support-close:hover { color: var(--ink); border-color: var(--blue); }
.support-close:focus-visible { outline: 3px solid #1717b824; outline-offset: 2px; }
.support-options { padding: 8px 18px 16px; }
.support-option { padding: 11px 0; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.support-option:last-child { border-bottom: 0; padding-bottom: 2px; }
.support-option small { color: var(--muted); font-size: .74rem; font-weight: 700; }
.support-option a { width: fit-content; color: var(--blue); font-size: .9rem; font-weight: 750; text-decoration: none; overflow-wrap: anywhere; }
.support-option a:hover { text-decoration: underline; }
.modal-open { overflow: hidden; }
.modal-backdrop { position: fixed; z-index: 80; inset: 0; padding: 24px; background: #070b16b8; backdrop-filter: blur(5px); display: grid; place-items: center; }
.metrics-modal { width: min(980px, 100%); max-height: min(820px, calc(100vh - 48px)); border: 1px solid var(--card-border); border-radius: 18px; color: var(--ink); background: var(--surface); box-shadow: 0 26px 70px #0000004a; overflow-y: auto; }
.modal-header { padding: 22px 24px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.modal-header .eyebrow { color: var(--blue); }
.modal-header h2 { margin: 5px 0 4px; font-size: 1.35rem; }
.modal-header p { margin: 0; color: var(--muted); font-size: .84rem; }
.modal-close { width: 38px; height: 38px; flex: 0 0 38px; padding: 0; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--surface-soft); font-size: 1.55rem; line-height: 1; }
.modal-close:hover { color: var(--ink); border-color: var(--blue); }
.modal-close:focus-visible { outline: 3px solid #1717b824; outline-offset: 2px; }
#serverMetricsContent { padding: 20px 24px 24px; }
.chart-wrap { width: 100%; overflow-x: auto; scrollbar-color: #b9c0d3 var(--surface-soft); scrollbar-width: thin; }
#serverMetricsChart { display: block; width: 100%; min-width: 620px; height: 360px; }
.server-metrics-legend { margin-top: 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.server-legend-item { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface-soft); display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: .76rem; text-align: left; transition: opacity .15s ease, border-color .15s ease, background .15s ease; }
.server-legend-item:hover { border-color: var(--blue); }
.server-legend-item:focus-visible { outline: 3px solid #1717b824; outline-offset: 2px; }
.server-legend-item.is-hidden { opacity: .48; background: transparent; }
.server-legend-item.is-hidden .server-legend-label { text-decoration: line-through; }
.server-legend-item.is-hidden .server-legend-swatch { filter: grayscale(1); }
.server-legend-swatch { width: 10px; height: 10px; border-radius: 3px; }
.server-legend-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-legend-item strong { color: var(--muted); font-size: .7rem; white-space: nowrap; }
.metrics-modal > .empty-state { padding: 60px 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf1f8;
  --muted: #aab4c7;
  --line: #2b3548;
  --surface: #161d2b;
  --surface-soft: #1c2433;
  --surface-subtle: #1a2231;
  --surface-hover: #1d2636;
  --canvas: #0d111b;
  --field-border: #3a465c;
  --card-border: #2a3447;
  --track: #303a4c;
  --navy: #dfe3ff;
  --blue: #8187ff;
  --green: #42c996;
  --red: #f07587;
  --amber: #e4aa45;
}
[data-theme="dark"] .topbar { background: linear-gradient(120deg, #050425, #10105e); }
[data-theme="dark"] .login-card,
[data-theme="dark"] .metric-card,
[data-theme="dark"] .table-card { box-shadow: 0 12px 32px #00000038; }
[data-theme="dark"] input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #8187ff30; }
[data-theme="dark"] .button-secondary { color: #e9edff; background: #252e45; }
[data-theme="dark"] .filter-chip input:checked + span { color: #e4e7ff; border-color: #555d94; background: #292a52; }
[data-theme="dark"] .status-accepted { color: #72deb7; background: #173c31; }
[data-theme="dark"] .status-blocked { color: #ff9baa; background: #47212b; }
[data-theme="dark"] .status-flag { color: #f1c36c; background: #473718; }
[data-theme="dark"] .status-greylisting { color: #c2cada; background: #30394a; }
[data-theme="dark"] .status-hold { color: #ffc078; background: #49301b; }
[data-theme="dark"] .status-inexistent { color: #dda2ff; background: #3d244c; }
[data-theme="dark"] .status-other { color: #eac371; background: #42351c; }
[data-theme="dark"] .table-scroll { scrollbar-color: #556077 #1c2433; }
[data-theme="dark"] .table-scroll::-webkit-scrollbar-track { background: #1c2433; }
[data-theme="dark"] .table-scroll::-webkit-scrollbar-thumb { background: #556077; }
[data-theme="dark"] .table-loading { color: var(--ink); background: #121925ee; }
[data-theme="dark"] .alert { color: #ffb1bd; background: #49212a; }
[data-theme="dark"] .form-success { color: #78ddb7 !important; border-color: #42c99645; background: #153b30; }
[data-theme="dark"] .toast { background: #303b52; }
[data-theme="dark"] .toast-error { background: #8f3547; }
[data-theme="dark"] .modal-backdrop { background: #03060dd1; }
[data-theme="dark"] .metrics-modal { box-shadow: 0 26px 70px #00000080; }
[data-theme="dark"] .modal-close:focus-visible { outline-color: #8187ff42; }
[data-theme="dark"] .server-legend-item:focus-visible { outline-color: #8187ff42; }
[data-theme="dark"] .support-panel { box-shadow: 0 20px 54px #00000080; }
[data-theme="dark"] .support-close:focus-visible { outline-color: #8187ff42; }
@media (max-width: 1100px) {
  .topbar { min-height: 245px; padding-bottom: 72px; flex-direction: column; }
  .topbar-actions { width: 100%; justify-content: flex-start; }
  .account-label { width: 100%; max-width: 100%; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 980px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  table { min-width: 1050px; }
}
@media (max-width: 650px) {
  main { width: min(100% - 24px, 1420px); margin-bottom: 28px; }
  .topbar { min-height: 255px; padding: 22px 14px 70px; gap: 18px; }
  .dashboard-brand { align-items: center; gap: 12px; }
  .dashboard-logo { width: 76px; height: 48px; padding: 4px; border-radius: 9px; }
  .topbar h1 { font-size: 1.55rem; }
  .topbar-actions { gap: 8px; }
  .topbar-actions .button, .theme-toggle, .session-countdown { min-height: 44px; }
  .session-countdown { display: inline-flex; align-items: center; }
  .topbar .status-page-button { min-height: 44px; }
  .login-mode .topbar { min-height: 160px; padding-bottom: 60px; }
  .login-card { padding: 25px 20px; border-radius: 14px; }
  .login-logo { width: 112px; }
  .login-card h2 { font-size: 1.3rem; }
  input { min-height: 46px; font-size: 16px; }
  .cards { grid-template-columns: 1fr; gap: 12px; }
  .metric-card { min-height: 160px; padding: 20px; }
  .table-toolbar { padding: 17px; align-items: stretch; flex-direction: column; gap: 14px; }
  .table-controls { width: 100%; justify-items: stretch; }
  .search-actions { align-items: stretch; flex-direction: column; }
  .search-actions input { max-width: none; }
  .metrics-button { width: 100%; }
  .status-filters { justify-content: flex-start; }
  .table-loading { inset: 135px 0 0; padding: 20px; text-align: center; }
  .page-numbers { display: none; }
  .page-status { display: inline; }
  .pagination { padding: 12px 10px; gap: 7px; }
  .pagination-nav { min-width: 0 !important; padding: 0 10px; font-size: .78rem; }
  .toast-region { right: 12px; bottom: 12px; left: 12px; }
  .toast { width: 100%; max-width: none; }
  .support-widget { right: 14px; bottom: 18px; }
  .support-button { width: 50px; height: 50px; }
  .support-panel { top: auto; right: 0; bottom: 62px; width: min(320px, calc(100vw - 28px)); transform: none; }
  .modal-backdrop { padding: 12px; }
  .metrics-modal { max-height: calc(100vh - 24px); border-radius: 14px; }
  .modal-header { padding: 18px; }
  #serverMetricsContent { padding: 14px 18px 20px; }
  .server-metrics-legend { grid-template-columns: 1fr; }
  .site-footer { width: calc(100% - 24px); margin-top: -12px; flex-wrap: wrap; }
}
@media (max-width: 380px) {
  .rates-grid { grid-template-columns: 1fr; }
  .metric-delivery { min-height: auto; }
  .topbar-actions .button, .theme-toggle { padding-inline: 11px; font-size: .78rem; }
  .session-countdown { width: 100%; justify-content: center; }
}

.history-progress { padding: 0 22px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.history-progress p, #lastUpdated { color: var(--muted); font-size: .76rem; }
.history-progress .history-partial { color: var(--amber); }
.load-more-panel { margin: 0 22px 18px; padding: 20px; display: flex; align-items: center; gap: 16px; border: 1px solid #d4d6f5; border-radius: 12px; background: linear-gradient(110deg, #f0f0ff, #f8faff); }
.load-more-symbol { width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; border: 1px solid #dddffa; border-radius: 12px; color: #3535bc; background: #fff; }
.load-more-copy { flex: 1; min-width: 0; }
.load-more-copy strong { display: block; color: var(--ink); font-size: .94rem; line-height: 1.4; }
.load-more-copy p { margin: 5px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.6; }
.load-more-button { min-height: 46px; min-width: 212px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; flex-shrink: 0; padding: 12px 18px; color: #fff; background: #2929bf; border: 1px solid transparent; border-radius: 9px; font-size: .84rem; box-shadow: 0 4px 10px #2222a522; }
.load-more-button:hover:not(:disabled) { background: #171797; box-shadow: 0 6px 16px #2222a530; }
.load-more-button:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.load-more-button.is-loading { opacity: 1; color: #484ba0; background: #e1e3fa; border-color: #cdd0ef; box-shadow: none; }
.load-more-spinner { display: none; width: 17px; height: 17px; flex: 0 0 17px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.load-more-button.is-loading .load-more-spinner { display: block; }
.load-more-button.is-loading .load-more-arrow { display: none; }
[data-theme="dark"] .load-more-panel { border-color: #41476d; background: linear-gradient(110deg, #252741, #1d2535); }
[data-theme="dark"] .load-more-symbol { color: #afb3ff; border-color: #43496b; background: #303450; }
[data-theme="dark"] .load-more-button { background: #5755d6; }
[data-theme="dark"] .load-more-button:hover:not(:disabled) { background: #6563e4; }
[data-theme="dark"] .load-more-button.is-loading { color: #c4c8ff; border-color: #4d537d; background: #343951; }
@media (max-width: 760px) {
  .load-more-panel { margin-inline: 17px; padding: 17px; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 13px; }
  .load-more-symbol { width: 40px; height: 40px; border-radius: 10px; }
  .load-more-button { grid-column: 1 / -1; width: 100%; min-width: 0; }
}
.metrics-data { margin-top: 20px; }
.metrics-data summary { cursor: pointer; padding: 10px 0; font-weight: 700; }
.metrics-data table { min-width: 500px; }
.metrics-data caption { padding: 12px; color: var(--muted); text-align: left; }
.site-footer a { color: var(--blue); font-size: .8rem; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Investigation controls share the dashboard's theme and selected period. */
.scope-card { margin-bottom: 18px; padding: 22px; border: 1px solid var(--card-border); border-radius: 15px; background: var(--surface); box-shadow: 0 8px 22px #1524420b; }
.scope-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.scope-heading .eyebrow { color: var(--blue); }
.scope-heading h2 { margin: 5px 0 0; font-size: 1.13rem; }
.scope-heading p { max-width: 350px; margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.6; }
.scope-form { display: flex; align-items: end; gap: 14px; flex-wrap: wrap; }
.scope-form label { display: grid; gap: 7px; flex: 1; min-width: 180px; color: var(--ink); font-size: .78rem; font-weight: 650; }
.scope-form select { width: 100%; min-height: 43px; padding: 10px 32px 10px 12px; border: 1px solid var(--field-border); border-radius: 10px; color: var(--ink); background: var(--surface); font: inherit; }
.scope-form input { min-width: 0; }
.scope-apply { min-height: 43px; }
.custom-dates { display: flex; gap: 12px; flex: 1; }
.custom-dates label { min-width: 145px; }
.scope-summary { margin: 14px 0 0; color: var(--muted); font-size: .77rem; line-height: 1.6; }
.scope-card .form-error:empty { display: none; }
.metric-card-action { text-align: left; width: 100%; transition: border-color .15s ease, box-shadow .15s ease; }
.metric-card-action:hover { border-color: var(--blue); box-shadow: 0 8px 24px #1717b818; }
.metric-card-action[aria-pressed="true"] { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.metric-card .metric-action-hint { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; color: var(--blue); font-size: .72rem; font-weight: 700; }
.metrics-explanation { margin: -4px 2px 18px; color: var(--muted); font-size: .76rem; line-height: 1.6; }
.export-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--field-border); color: var(--ink); background: var(--surface); white-space: nowrap; padding: 9px 13px; }
.export-button:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.table-filter-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 22px 0; }
.table-filter-summary p { margin: 0; color: var(--muted); font-size: .72rem; line-height: 1.6; }
.clear-filters { border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; background: var(--surface-soft); color: var(--blue); font-weight: 650; font-size: .75rem; white-space: nowrap; }
.message-row { cursor: pointer; }
.message-details-button { padding: 0; border: 0; background: transparent; color: var(--blue); text-align: left; font: inherit; font-weight: 650; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; overflow-wrap: anywhere; }
.message-details-button:hover { text-decoration-color: currentColor; }
.policy-note { margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line); color: var(--ink); font-size: .75rem; font-weight: 650; }
.policy-note small { display: block; margin-top: 3px; color: var(--muted); font-size: .68rem; font-weight: 400; }
.message-details-modal { width: min(840px, calc(100% - 32px)); max-height: calc(100dvh - 40px); padding: 0; border: 1px solid var(--card-border); border-radius: 16px; color: var(--ink); background: var(--surface); box-shadow: 0 26px 70px #0000004a; overflow-y: auto; }
.message-details-modal::backdrop { background: #070b16b8; backdrop-filter: blur(4px); }
.message-details-modal .modal-header { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.message-details-modal .modal-header > div { min-width: 0; }
.message-details-modal .eyebrow { color: var(--blue); }
#detailSubject { max-height: 5em; overflow-y: auto; overflow-wrap: anywhere; }
.message-details-body { padding: 22px 24px; }
.detail-status-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.detail-status-grid section { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); display: grid; gap: 8px; align-content: start; }
.detail-status-grid span { color: var(--muted); font-size: .72rem; font-weight: 650; }
.detail-status-grid strong { font-size: 1rem; }
.detail-status-grid small { color: var(--muted); font-size: .72rem; line-height: 1.6; }
.detail-explanation { color: var(--muted); font-size: .78rem; line-height: 1.7; }
.detail-copy-toolbar { margin: 20px 0; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
#detailCopyStatus { font-size: .77rem; color: var(--blue); }
.message-detail-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 24px; margin-bottom: 0; }
.message-detail-field { min-width: 0; padding: 14px 0; border-bottom: 1px solid var(--line); }
.message-detail-field:first-child { grid-column: 1 / -1; }
.message-detail-field dt { color: var(--muted); font-size: .73rem; margin-bottom: 7px; }
.message-detail-field dd { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 0; font-size: .84rem; line-height: 1.65; }
.message-detail-field dd span { min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.copy-field { flex-shrink: 0; padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--blue); background: var(--surface-soft); font-size: .69rem; }
.detail-copy-fallback { display: grid; gap: 8px; font-size: .77rem; color: var(--muted); }
.detail-copy-fallback textarea { width: 100%; padding: 10px; border: 1px solid var(--field-border); border-radius: 8px; background: var(--surface-soft); color: var(--ink); }
.scope-form :focus-visible, .metric-card-action:focus-visible, .export-button:focus-visible, .clear-filters:focus-visible, .message-details-button:focus-visible, .copy-field:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
@media (max-width: 760px) {
  .scope-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .scope-card { padding: 18px; }
  .scope-form { display: grid; grid-template-columns: minmax(0,1fr); }
  .scope-form label { min-width: 0; }
  .scope-form select, .scope-form input { font-size: 16px; min-height: 44px; }
  .custom-dates { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .scope-apply { width: 100%; }
  .search-actions { flex-wrap: wrap; }
  .search-actions input { max-width: none; }
  .table-filter-summary { padding-inline: 17px; align-items: flex-start; }
  .message-details-body { padding: 16px; }
  .message-details-modal .modal-header { padding: 18px 16px; }
  .detail-status-grid, .message-detail-fields { grid-template-columns: minmax(0,1fr); }
}
