:root {
  color-scheme: light;
  --ink: #172b2c;
  --muted: #657778;
  --line: #dce7e3;
  --paper: #f4f8f5;
  --surface: #ffffff;
  --teal: #0e6b61;
  --teal-dark: #09554d;
  --mint: #d9eee7;
  --blue: #e4eff7;
  --amber: #fff0cd;
  --red: #a63b37;
  --red-pale: #fae5e1;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; }
.hidden, .button.hidden, .secret-box.hidden { display: none; }

.topbar { min-height: 68px; padding: 0 clamp(18px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; background: #103f3c; color: white; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1rem; font-weight: 720; text-decoration: none; letter-spacing: -.02em; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; background: #d9eee7; color: #103f3c; font-size: .9rem; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.connection { color: #d0e5de; font-size: .82rem; }
.page-shell { width: min(1180px, calc(100% - 36px)); margin: 42px auto 64px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 24px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.8rem, 4vw, 2.45rem); letter-spacing: -.045em; line-height: 1.08; }
h2 { margin-bottom: 18px; font-size: 1.25rem; letter-spacing: -.025em; }
h3 { margin: 0 0 5px; font-size: 1rem; }
.eyebrow { margin: 0 0 7px; color: var(--teal); font-size: .69rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.muted { color: var(--muted); }
.hint, .footer-note { color: var(--muted); font-size: .84rem; line-height: 1.55; }
.footer-note { margin: 24px 0 0; }

.login-card { width: min(460px, 100%); margin: 8vh auto; padding: clamp(24px, 5vw, 42px); border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: 0 12px 36px #193b3310; }
.login-card h1 { margin-bottom: 12px; }
.login-card > p:not(.eyebrow) { margin-bottom: 24px; line-height: 1.55; }
.stack { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.stack label, .filter-label { color: #304747; font-size: .84rem; font-weight: 680; }
input, select { width: 100%; min-height: 43px; padding: 9px 11px; border: 1px solid #cbd9d5; border-radius: 9px; background: #fff; color: var(--ink); }
input::placeholder { color: #8c9a98; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid #62b9a9; outline-offset: 2px; border-color: var(--teal); }
.stack input + label, .stack select + label { margin-top: 6px; }

.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 14px; border: 1px solid transparent; border-radius: 9px; font-size: .84rem; font-weight: 700; transition: background-color .15s ease, transform .15s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button-primary { background: var(--teal); color: white; }
.button-primary:hover:not(:disabled) { background: var(--teal-dark); }
.button-secondary { border-color: #c7dcd5; background: #edf6f2; color: #14594f; }
.button-secondary:hover:not(:disabled) { background: #dfefe9; }
.button-quiet { border-color: #d8e2df; background: transparent; color: #3c5553; }
.topbar .button-quiet { border-color: #a3c9be; color: #f4f8f5; }
.button-small { min-height: 32px; padding: 6px 10px; font-size: .76rem; }

.notice { margin: 0 0 20px; padding: 12px 15px; border: 1px solid #bddfd4; border-radius: 10px; background: #eaf6f1; color: #245a4f; line-height: 1.45; }
.notice-error { border-color: #ebc3bd; background: #fff0ed; color: #8f302b; }
.notice-info { border-color: #c9dce6; background: #edf5fa; color: #31596b; }
.summary-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric { min-height: 95px; display: flex; flex-direction: column; justify-content: space-between; padding: 16px 17px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.metric span { color: var(--muted); font-size: .77rem; line-height: 1.3; }
.metric strong { font-size: 1.45rem; letter-spacing: -.04em; }
.metric-warning { border-color: #e8d29b; background: #fffaf0; }
.metric-error { border-color: #ebc3bd; background: #fff4f1; }

.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.panel { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 4px 14px #103c3510; }
.panel-wide { grid-column: 1 / -1; }
.panel .eyebrow { margin-bottom: 5px; }
.panel h2 { margin-bottom: 18px; }
.panel-heading { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin-bottom: 16px; }
.panel-heading h2 { margin-bottom: 0; }
.panel-heading > div > .eyebrow { margin-bottom: 5px; }
.filter-label { display: flex; align-items: center; gap: 10px; }
.filter-label select { width: auto; min-width: 145px; min-height: 37px; }
.pager { display: flex; align-items: center; justify-content: end; gap: 11px; margin-top: 12px; color: var(--muted); font-size: .76rem; }

.agent-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.agent-card { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fbfdfb; }
.agent-card-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.agent-card-head > div { min-width: 0; }
.agent-url, .agent-meta { margin: 0; color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.agent-meta { margin: 12px 0; line-height: 1.45; }
.badge { flex: 0 0 auto; padding: 4px 8px; border-radius: 99px; background: #e7edeb; color: #536462; font-size: .7rem; font-weight: 760; text-transform: capitalize; }
.badge-healthy { background: var(--mint); color: #176354; }
.badge-paused { background: #e8edef; color: #526462; }
.badge-unreachable, .badge-incompatible { background: var(--red-pale); color: #8e3932; }
.badge-unverified { background: var(--amber); color: #785b14; }
.button-row { display: flex; flex-wrap: wrap; gap: 7px; }

.secret-box { display: grid; gap: 9px; margin-top: 18px; padding: 14px; border: 1px solid #b8d7ce; border-radius: 10px; background: #f0f8f4; }
.secret-box strong { font-size: .86rem; }
.secret-box p { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.secret-box code { display: block; overflow-wrap: anywhere; padding: 8px 9px; border-radius: 7px; background: #e0eee8; color: #174b43; font-size: .78rem; user-select: all; }
.secret-label { color: var(--muted); font-size: .71rem; font-weight: 750; letter-spacing: .04em; }
#metric-saturation strong, #metric-storage strong, #metric-agent-review-age { font-size: .9rem; line-height: 1.35; overflow-wrap: anywhere; }
.compact-list { margin-top: 18px; }
.search-label { display: block; margin-top: 18px; margin-bottom: 7px; color: #304747; font-size: .84rem; font-weight: 680; }
.compact-empty { margin-bottom: 0; font-size: .83rem; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .82rem; }
.data-table th { padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .72rem; font-weight: 760; letter-spacing: .03em; }
.data-table td { padding: 11px 12px; border-bottom: 1px solid #edf1ef; vertical-align: middle; }
.compact-table { font-size: .77rem; }
.compact-table td { padding: 8px; }
.compact-table td:last-child { text-align: right; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table th:first-child, .data-table td:first-child { padding-left: 2px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .75rem; overflow-wrap: anywhere; }
.state-cell { font-weight: 750; text-transform: capitalize; }
.state-accepted { color: #1b6a55; }
.state-dead { color: #a23d35; }
.state-sending { color: #926615; }
.state-pending { color: #466b88; }
.table-wrap { width: 100%; overflow-x: auto; }
.site-footer { display: flex; justify-content: center; gap: 8px; padding: 21px; color: #70817d; font-size: .76rem; }

@media (max-width: 850px) {
  .summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .agent-cards { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .topbar { min-height: 60px; padding-inline: 16px; }
  .topbar-actions { gap: 9px; }
  .connection { font-size: .72rem; }
  .page-shell { width: min(100% - 24px, 520px); margin: 25px auto 42px; }
  .page-heading { align-items: start; }
  .page-heading .button { flex: 0 0 auto; }
  .dashboard-grid { grid-template-columns: 1fr; gap: 12px; }
  .panel-wide { grid-column: auto; }
  .panel { padding: 17px; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .metric { min-height: 82px; padding: 12px; }
  .metric span { font-size: .72rem; }
  .metric strong { font-size: 1.25rem; }
  .panel-heading { align-items: start; flex-direction: column; }
  .filter-label { width: 100%; justify-content: space-between; }
  .filter-label select { flex: 1; }
  .data-table { min-width: 650px; }
  .compact-table { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button { transition: none; }
}
