:root {
  color: #18312d;
  background: #eef3f0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-synthesis: none;
  --ink: #18312d;
  --muted: #63736f;
  --line: #d8e1dd;
  --surface: #ffffff;
  --surface-soft: #f7faf8;
  --brand: #123b35;
  --brand-light: #dcebe5;
  --ok: #16724f;
  --ok-soft: #e1f4eb;
  --warn: #9a6516;
  --warn-soft: #fff2d7;
  --danger: #a33a32;
  --danger-soft: #fde9e7;
  --shadow: 0 18px 45px rgb(19 59 53 / 8%);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: #eef3f0;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 100% 0, rgb(217 151 50 / 12%), transparent 30rem),
    linear-gradient(180deg, #f7faf8 0, #eef3f0 32rem);
}

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgb(217 151 50 / 55%);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  padding: 0.65rem 0.9rem;
  color: white;
  background: var(--brand);
  border-radius: 0.65rem;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  width: min(100%, 72rem);
  min-height: 100vh;
  margin: 0 auto;
  padding:
    max(1rem, env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    max(1.25rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
}

.topbar,
.topbar-actions,
.welcome-row,
.section-heading,
.install-panel,
.notice-card,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar-actions {
  justify-content: flex-end;
  gap: 0.5rem;
}

.topbar {
  min-height: 4.25rem;
  margin-bottom: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  display: grid;
  width: 2.65rem;
  height: 2.65rem;
  color: white;
  background: var(--brand);
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 0.9rem;
  box-shadow: 0 9px 22px rgb(18 59 53 / 18%);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  place-items: center;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.05rem;
}

.brand small {
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.icon-button,
.secondary-button {
  min-height: 2.55rem;
  padding: 0.65rem 0.9rem;
  color: var(--brand);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.icon-button:hover,
.secondary-button:hover {
  background: var(--surface-soft);
}

.status-panel,
.auth-panel,
.public-summary,
.install-panel,
.metric-card,
.notice-card,
.table-card,
.report-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.public-summary {
  margin-bottom: 1rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, var(--surface), var(--brand-light));
  border-radius: 1rem;
}

.public-summary p:last-child {
  max-width: 48rem;
  margin: 0.55rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1rem;
  padding: 1.25rem;
  border-radius: 1rem;
}

.auth-panel p:not(.eyebrow) {
  max-width: 42rem;
  margin: 0.45rem 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  padding: 0.75rem 1rem;
  color: white;
  background: var(--brand);
  border-radius: 0.8rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.primary-button:hover {
  background: #0b2f2a;
}

.status-panel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
}

.status-panel strong {
  display: block;
  margin-bottom: 0.18rem;
}

.status-panel p {
  margin: 0.12rem 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.status-dot {
  width: 0.7rem;
  height: 0.7rem;
  margin-top: 0.35rem;
  background: var(--warn);
  border-radius: 50%;
  box-shadow: 0 0 0 0.34rem var(--warn-soft);
}

.status-online {
  border-color: #badfce;
  background: var(--ok-soft);
}

.status-online .status-dot {
  background: var(--ok);
  box-shadow: 0 0 0 0.34rem rgb(22 114 79 / 13%);
}

.status-down {
  border-color: #efc4bf;
  background: var(--danger-soft);
}

.status-down .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 0.34rem rgb(163 58 50 / 13%);
}

.status-stale,
.status-unknown {
  border-color: #eed5aa;
  background: var(--warn-soft);
}

.install-panel {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
}

.install-panel strong {
  display: block;
}

.install-panel p {
  margin: 0.18rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  margin: 1.25rem 0;
  padding: 0.3rem;
  background: #dde6e2;
  border-radius: 0.9rem;
}

.tab {
  min-height: 2.6rem;
  padding: 0.55rem;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 0.65rem;
  font-weight: 700;
  cursor: pointer;
}

.tab.is-active {
  color: var(--brand);
  background: var(--surface);
  box-shadow: 0 3px 12px rgb(18 59 53 / 8%);
}

.tab-panel {
  animation: panel-in 160ms ease-out;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(0.25rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(1.55rem, 5vw, 2.25rem);
}

h2 {
  font-size: 1.1rem;
}

.role-chip,
.count-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.7rem;
  color: var(--brand);
  background: var(--brand-light);
  border-radius: 99rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1.15rem 0;
}

.metric-card {
  min-height: 8.5rem;
  padding: 1rem;
  border-radius: 1rem;
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
}

.metric-card span {
  font-size: 0.78rem;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin: 0.85rem 0 0.5rem;
  color: var(--ink);
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  letter-spacing: -0.04em;
}

.metric-card small {
  font-size: 0.72rem;
}

.metric-highlight {
  color: white;
  background: var(--brand);
  border-color: var(--brand);
}

.metric-highlight span,
.metric-highlight small,
.metric-highlight strong {
  color: inherit;
}

.notice-card {
  padding: 1rem;
  border-radius: 1rem;
}

.notice-card p:not(.eyebrow) {
  max-width: 36rem;
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.notice-card button {
  flex: 0 0 auto;
  min-height: 2.75rem;
  padding: 0.65rem 0.9rem;
  color: #7e8a87;
  background: #edf1ef;
  border: 1px solid #d6ddda;
  border-radius: 0.75rem;
  cursor: not-allowed;
}

.section-heading {
  margin-bottom: 1rem;
}

.table-card,
.report-card {
  overflow: hidden;
  border-radius: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td {
  font-size: 0.88rem;
}

.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.empty-state {
  padding: 2.5rem 1rem;
  color: var(--muted);
  text-align: center;
}

.report-card {
  padding: 1rem;
}

.report-card > div:first-child span,
.report-card > div:first-child strong {
  display: block;
}

.report-card > div:first-child span {
  color: var(--muted);
  font-size: 0.75rem;
}

.report-card > div:first-child strong {
  margin-top: 0.25rem;
}

.report-card dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin: 1rem 0 0;
}

.report-card dl div {
  padding: 0.8rem;
  background: var(--surface-soft);
  border-radius: 0.8rem;
}

.report-card dt {
  color: var(--muted);
  font-size: 0.72rem;
}

.report-card dd {
  margin: 0.45rem 0 0;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.security-note {
  margin: 1rem 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

footer {
  margin-top: 2.5rem;
  padding: 1rem 0 0;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
}

.footer-identity,
.footer-links {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.footer-links a,
.legal-card a {
  color: var(--brand);
  font-weight: 700;
}

.brand-link {
  color: inherit;
  text-decoration: none;
}

.legal-shell {
  width: min(100%, 56rem);
}

.legal-card {
  padding: clamp(1.25rem, 4vw, 2.5rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: var(--shadow);
}

.legal-card h1 {
  margin-bottom: 0.5rem;
}

.legal-card h2 {
  margin-top: 1.8rem;
}

.legal-card p,
.legal-card li {
  color: var(--muted);
  line-height: 1.65;
}

.legal-card ul {
  padding-left: 1.25rem;
}

.legal-updated {
  margin-top: 0;
  font-size: 0.82rem;
}

.noscript {
  margin: 1rem;
  padding: 1rem;
  color: #6a261f;
  background: var(--danger-soft);
  border: 1px solid #efc4bf;
  border-radius: 0.8rem;
}

@media (min-width: 52rem) {
  .app-shell {
    padding-right: 2rem;
    padding-left: 2rem;
  }

  .metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 36rem) {
  .auth-panel {
    grid-template-columns: 1fr;
  }

  .primary-button {
    width: 100%;
  }

  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .notice-card {
    align-items: stretch;
    flex-direction: column;
  }

  .notice-card button {
    width: 100%;
  }

  .report-card dl {
    grid-template-columns: 1fr;
  }

  footer,
  .footer-identity {
    align-items: flex-start;
    flex-direction: column;
  }

  th,
  td {
    padding-right: 0.7rem;
    padding-left: 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
