:root {
  color-scheme: light;
  --page: #f7f5f0;
  --surface: #ffffff;
  --surface-muted: #efede7;
  --ink: #141414;
  --muted: #5d616a;
  --line: #111111;
  --yellow: #ffe168;
  --yellow-strong: #ffd43b;
  --green: #b9f6d0;
  --purple: #d8c6ff;
  --danger: #ef5b53;
  --success: #13894f;
  --shadow: 10px 10px 0 #111111;
  --shadow-small: 5px 5px 0 #111111;
  --max-width: 1180px;
  --header-height: 82px;
  --sans: "Plus Jakarta Sans", Arial, Helvetica, sans-serif;
  --mono: "IBM Plex Mono", Consolas, monospace;
}

html.dark {
  color-scheme: dark;
  --page: #171717;
  --surface: #222222;
  --surface-muted: #2b2b2b;
  --ink: #f7f5f0;
  --muted: #c0c0bd;
  --line: #f7f5f0;
  --yellow: #f4d65d;
  --yellow-strong: #ffd43b;
  --green: #77dba4;
  --purple: #bda6ed;
  --danger: #ff7a72;
  --success: #61d897;
  --shadow: 10px 10px 0 #f7f5f0;
  --shadow-small: 5px 5px 0 #f7f5f0;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
  background: var(--page);
}

body {
  width: 100%;
  max-width: 100%;
  min-width: 320px;
  margin: 0;
  overflow-x: clip;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition: background-color 160ms ease, color 160ms ease;
}

html.menu-open,
body.menu-open { overflow: hidden; overscroll-behavior: none; }

::selection { background: var(--yellow); color: #111; }

button,
a { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, p { margin-top: 0; }

:focus-visible { outline: 4px solid #4b7bec; outline-offset: 4px; }

.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;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 9999;
  transform: translateY(-160%);
  border: 3px solid var(--line);
  background: var(--yellow);
  color: #111;
  padding: 10px 14px;
  font-weight: 800;
  box-shadow: var(--shadow-small);
}
.skip-link:focus { transform: translateY(0); }

.section-container,
.header-container,
.footer-container {
  width: min(var(--max-width), calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: var(--header-height);
  border-bottom: 4px solid var(--line);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(12px);
}

.header-container {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 3px solid var(--line);
  background: var(--yellow);
  color: #111;
  font-weight: 800;
  box-shadow: 3px 3px 0 var(--line);
}

.brand-text { font-size: 1.05rem; font-weight: 800; white-space: nowrap; }
.desktop-nav { margin-left: auto; }
.nav-list { display: flex; align-items: center; gap: 2px; }
.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}
.nav-link:hover,
.nav-link--active { color: var(--ink); background: var(--surface-muted); }
.nav-link--active { box-shadow: inset 0 -3px 0 var(--line); }

.header-actions { display: flex; align-items: center; gap: 9px; }
.theme-toggle,
.mobile-menu-toggle,
.mobile-menu-close {
  border: 3px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}
.theme-toggle { width: 44px; height: 44px; display: grid; place-items: center; font-size: 1.2rem; }
.theme-toggle:hover,
.mobile-menu-toggle:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--line); }

.connection-pill {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--line);
  background: var(--surface);
  padding: 7px 11px;
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
}
.connection-dot { width: 9px; height: 9px; background: #9b9b9b; }
.connection-pill.is-online .connection-dot { background: var(--success); }
.connection-pill.is-error .connection-dot { background: var(--danger); }

.mobile-menu-toggle {
  width: 46px;
  height: 44px;
  display: none;
  align-content: center;
  justify-items: center;
  gap: 5px;
  padding: 8px;
  background: var(--yellow);
  color: #111;
  box-shadow: 4px 4px 0 var(--line);
}
.menu-line { width: 23px; height: 3px; background: #111; }

.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  background: rgb(0 0 0 / 56%);
  transition: opacity 180ms ease, visibility 0s linear 180ms;
}
.mobile-nav-overlay.active { visibility: visible; pointer-events: auto; opacity: 1; transition-delay: 0s; }
.mobile-nav-panel {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 1200;
  width: min(360px, calc(100vw - 28px));
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(105%, 0, 0);
  border-left: 4px solid var(--line);
  background: var(--surface);
  box-shadow: -12px 0 0 rgb(0 0 0 / 15%);
  transition: transform 220ms ease, visibility 0s linear 220ms;
}
.mobile-nav-panel.active { visibility: visible; pointer-events: auto; transform: translate3d(0, 0, 0); transition-delay: 0s; }
.mobile-nav-header { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 3px solid var(--line); }
.mobile-menu-close { width: 42px; height: 42px; display: grid; place-items: center; font-size: 1.7rem; }
.mobile-nav-body { padding: 22px; }
.mobile-nav-list { display: grid; gap: 10px; }
.mobile-nav-link { display: block; border: 2px solid var(--line); padding: 13px 15px; font-weight: 700; }
.mobile-nav-link:hover,
.mobile-nav-link--highlight { background: var(--yellow); color: #111; }

.monitoring-main { min-height: 70vh; }
.monitoring-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 4px solid var(--line);
  background: var(--surface);
}
.monitoring-hero::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -140px;
  width: 420px;
  height: 420px;
  border: 4px solid var(--line);
  background: var(--yellow);
  transform: rotate(9deg);
  opacity: .78;
}
.monitoring-hero-grid {
  position: relative;
  z-index: 1;
  min-height: 470px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(290px, .65fr);
  align-items: center;
  gap: 72px;
  padding-block: 72px;
}
.section-kicker,
.card-kicker {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: .77rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.monitoring-title {
  max-width: 760px;
  margin-bottom: 20px;
  font-size: clamp(2.9rem, 7vw, 5.6rem);
  line-height: .98;
  letter-spacing: -.065em;
}
.monitoring-lead {
  max-width: 670px;
  margin-bottom: 0;
  border-left: 5px solid var(--line);
  padding-left: 20px;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.18rem);
}
.status-summary {
  border: 4px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.status-summary-label {
  display: block;
  border-bottom: 3px solid var(--line);
  background: var(--yellow);
  color: #111;
  padding: 13px 17px;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}
.status-summary strong { display: block; padding: 22px 18px 6px; font-size: 1.4rem; }
.status-summary p { margin: 0; padding: 0 18px 18px; color: var(--muted); font-size: .82rem; }
.small-action-button {
  width: calc(100% - 36px);
  min-height: 44px;
  margin: 0 18px 18px;
  border: 3px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: .78rem;
  font-weight: 800;
  box-shadow: 4px 4px 0 var(--line);
}
.small-action-button:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--line); }

.monitoring-section { padding-block: 92px; border-bottom: 4px solid var(--line); }
.monitoring-section--page { background: var(--page); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 30px; }
.metric-card {
  min-width: 0;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  border: 4px solid var(--line);
  background: var(--surface);
  padding: 24px;
  box-shadow: var(--shadow-small);
}
.metric-card--yellow { background: var(--yellow); color: #111; }
.metric-card--soft { background: var(--purple); color: #111; }
.metric-label { margin-bottom: 28px; font-size: .77rem; font-weight: 800; text-transform: uppercase; }
.metric-value { overflow-wrap: anywhere; font-size: clamp(2.1rem, 4vw, 3.5rem); line-height: 1; letter-spacing: -.06em; }
.metric-card small { margin-top: auto; padding-top: 22px; color: inherit; opacity: .72; font-size: .76rem; line-height: 1.5; }

.monitoring-grid { display: grid; gap: 28px; margin-top: 28px; }
.monitoring-grid--wide { grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); }
.monitoring-grid--equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.monitor-card {
  min-width: 0;
  border: 4px solid var(--line);
  background: var(--surface);
  padding: 28px;
  box-shadow: var(--shadow);
}
.card-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; border-bottom: 3px solid var(--line); padding-bottom: 18px; }
.card-heading-row--compact { align-items: center; }
.card-heading-row h2 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.35rem); line-height: 1.05; letter-spacing: -.04em; }
.card-kicker { margin-bottom: 7px; }
.state-badge {
  flex: 0 0 auto;
  border: 2px solid var(--line);
  background: var(--surface-muted);
  padding: 7px 10px;
  font-family: var(--mono);
  font-size: .67rem;
  font-weight: 700;
  text-transform: uppercase;
}
.state-badge--online { background: var(--green); color: #111; }
.state-badge--offline { background: var(--danger); color: #111; }

.resource-list { display: grid; gap: 24px; }
.resource-meta { display: flex; justify-content: space-between; gap: 18px; margin-bottom: 9px; font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.progress-track { height: 18px; overflow: hidden; border: 3px solid var(--line); background: var(--surface-muted); }
.progress-fill { display: block; width: 0; height: 100%; background: var(--yellow-strong); transition: width 400ms ease; }
.progress-fill--purple { background: var(--purple); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 28px; }
.detail-card { min-width: 0; border: 2px solid var(--line); background: var(--surface-muted); padding: 15px; }
.detail-card span { display: block; margin-bottom: 7px; color: var(--muted); font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.detail-card strong { display: block; overflow-wrap: anywhere; font-family: var(--mono); font-size: .82rem; }

.usage-visual { display: flex; width: 100%; height: 58px; overflow: hidden; border: 4px solid var(--line); background: var(--surface-muted); }
.usage-segment { height: 100%; transition: width 420ms ease; }
.usage-segment--anonymous { background: var(--purple); }
.usage-segment--owner { background: var(--yellow); }
.usage-legend { display: grid; gap: 12px; margin-top: 22px; }
.usage-legend > div { display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 9px; border-bottom: 1px solid color-mix(in srgb, var(--line) 28%, transparent); padding-bottom: 10px; font-size: .8rem; }
.legend-dot { width: 12px; height: 12px; border: 2px solid var(--line); }
.legend-dot--anonymous { background: var(--purple); }
.legend-dot--owner { background: var(--yellow); }
.privacy-note { margin: 22px 0 0; border-left: 4px solid var(--line); padding-left: 12px; color: var(--muted); font-size: .76rem; }

.filter-group { display: flex; gap: 7px; }
.filter-button { min-height: 35px; border: 2px solid var(--line); background: var(--surface); padding: 6px 10px; font-size: .69rem; font-weight: 800; }
.filter-button.active,
.filter-button:hover { background: var(--yellow); color: #111; }
.log-list { height: 460px; overflow: auto; border: 3px solid var(--line); background: #151515; color: #f5f3ed; padding: 15px; scrollbar-width: thin; }
.log-item { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; align-items: start; gap: 12px; border-bottom: 1px solid #383838; padding: 10px 0; font-family: var(--mono); font-size: .7rem; }
.log-item:last-child { border-bottom: 0; }
.log-time { color: #969696; }
.log-main { min-width: 0; }
.log-path { display: block; overflow-wrap: anywhere; color: #fff; font-weight: 700; }
.log-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; color: #a9a9a9; }
.log-status { min-width: 44px; border: 1px solid currentColor; padding: 2px 5px; text-align: center; font-weight: 700; }
.log-status--ok { color: #77dba4; }
.log-status--warn { color: #ffe168; }
.log-status--error { color: #ff7a72; }
.empty-state { margin: 0; color: #8a8a8a; font-family: var(--mono); font-size: .76rem; }

.table-wrap { max-height: 460px; overflow: auto; border: 3px solid var(--line); }
.monitor-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.monitor-table th,
.monitor-table td { padding: 13px 14px; border-bottom: 2px solid var(--line); text-align: left; }
.monitor-table th { position: sticky; top: 0; z-index: 1; background: var(--yellow); color: #111; font-size: .68rem; text-transform: uppercase; }
.monitor-table th:nth-child(n+2),
.monitor-table td:nth-child(n+2) { text-align: right; }
.monitor-table tbody tr:last-child td { border-bottom: 0; }
.monitor-table tbody tr:nth-child(even) { background: var(--surface-muted); }
.table-empty { color: var(--muted); text-align: center !important; }
.source-label { display: inline-flex; border: 2px solid var(--line); background: var(--surface); padding: 4px 7px; font-family: var(--mono); font-size: .67rem; font-weight: 700; }

.site-footer { border-top: 4px solid var(--line); background: var(--surface); padding-block: 32px; }
.footer-container { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.footer-container p { margin: 0; color: var(--muted); font-size: .78rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; font-size: .78rem; font-weight: 700; }
.footer-links a:hover { text-decoration: underline; }

@media (max-width: 1020px) {
  .desktop-nav { display: none; }
  .mobile-menu-toggle { display: grid; }
  .connection-pill { margin-left: auto; }
  .monitoring-hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .status-summary { max-width: 520px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .monitoring-grid--wide,
  .monitoring-grid--equal { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  :root { --header-height: 72px; }
  .section-container,
  .header-container,
  .footer-container { width: min(100% - 28px, var(--max-width)); }
  .site-header,
  .header-container { min-height: var(--header-height); }
  .brand-mark { width: 34px; height: 34px; }
  .brand-text { font-size: .95rem; }
  .connection-pill { display: none; }
  .theme-toggle { margin-left: auto; }
  .monitoring-hero-grid { min-height: auto; padding-block: 62px; }
  .monitoring-hero::after { right: -170px; bottom: -200px; }
  .monitoring-title { font-size: clamp(2.55rem, 14vw, 4.15rem); }
  .monitoring-lead { font-size: .98rem; }
  .monitoring-section { padding-block: 64px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 13px; }
  .metric-card { min-height: 170px; padding: 17px; box-shadow: 5px 5px 0 var(--line); }
  .metric-label { margin-bottom: 20px; font-size: .68rem; }
  .metric-value { font-size: 2rem; }
  .metric-card small { font-size: .68rem; }
  .monitor-card { padding: 19px; box-shadow: 6px 6px 0 var(--line); }
  .card-heading-row { flex-direction: column; align-items: stretch; }
  .card-heading-row--compact { align-items: flex-start; }
  .filter-group { align-self: flex-start; }
  .detail-grid { grid-template-columns: 1fr; }
  .log-list { height: 390px; }
  .log-item { grid-template-columns: 1fr auto; gap: 8px; }
  .log-time { grid-column: 1 / -1; }
  .footer-container { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 430px) {
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 155px; }
  .monitoring-title { font-size: 2.65rem; }
  .status-summary strong { font-size: 1.2rem; }
  .monitor-table th,
  .monitor-table td { padding: 11px 9px; font-size: .7rem; }
}

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