:root {
  color-scheme: dark;
  --page: #071116;
  --page-soft: #0a171d;
  --panel: #0d1c23;
  --panel-raised: #11242c;
  --panel-hover: #142b34;
  --line: #203840;
  --line-strong: #31505a;
  --text: #edf7f4;
  --text-soft: #a9bdbb;
  --text-muted: #728b8c;
  --accent: #68dda7;
  --accent-strong: #8aefc0;
  --accent-soft: rgba(104, 221, 167, 0.12);
  --blue: #72aef7;
  --purple: #ad8cf6;
  --amber: #f3bd65;
  --amber-soft: rgba(243, 189, 101, 0.12);
  --red: #f08383;
  --red-soft: rgba(240, 131, 131, 0.12);
  --radius-lg: 22px;
  --radius-md: 15px;
  --radius-sm: 10px;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% -8%, rgba(67, 145, 123, 0.15), transparent 34rem),
    radial-gradient(circle at 94% 12%, rgba(42, 91, 109, 0.12), transparent 30rem),
    var(--page);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: #03261b;
  background: var(--accent-strong);
  border-radius: 8px;
  font-weight: 750;
  transform: translateY(-160%);
  transition: transform 140ms ease;
}

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

.app-shell {
  width: min(100%, 1500px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 34px;
}

.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  border-bottom: 1px solid rgba(98, 132, 136, 0.2);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(104, 221, 167, 0.38);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(104, 221, 167, 0.2), rgba(104, 221, 167, 0.04));
  box-shadow: inset 0 0 0 4px rgba(2, 12, 14, 0.15);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span {
  position: absolute;
  content: "";
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}

.brand-mark::before {
  height: 10px;
  left: 9px;
  bottom: 8px;
}

.brand-mark span {
  height: 18px;
  left: 15px;
  bottom: 8px;
}

.brand-mark::after {
  height: 14px;
  right: 8px;
  bottom: 8px;
}

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

.brand strong {
  font-size: 15px;
  font-weight: 780;
  letter-spacing: 0.01em;
}

.brand small {
  margin-top: 1px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.connection-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 13px;
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(13, 28, 35, 0.68);
  font-size: 12px;
  font-weight: 680;
}

.state-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  box-shadow: 0 0 0 4px rgba(114, 139, 140, 0.12);
}

.connection-state[data-state="ready"] .state-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.connection-state[data-state="error"] .state-dot {
  background: var(--red);
  box-shadow: 0 0 0 4px var(--red-soft);
}

.connection-state[data-state="loading"] .state-dot {
  background: var(--amber);
  animation: pulse 1.7s ease infinite;
}

.icon-button,
.text-button,
.back-button,
.range-switcher button {
  border: 0;
  cursor: pointer;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  font-size: 12px;
  font-weight: 700;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.icon-button:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--panel-raised);
}

.icon-button:disabled {
  cursor: progress;
  opacity: 0.58;
}

.icon-button.is-spinning > span:first-child {
  animation: spin 700ms linear infinite;
}

main {
  padding: 68px 0 50px;
}

.intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 32px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 13px;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.intro-copy {
  max-width: 660px;
  margin-bottom: 0;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.6;
}

.updated-at {
  flex: 0 0 auto;
  margin: 0 0 3px;
  color: var(--text-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.notice {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin: 0 0 22px;
  padding: 15px 17px;
  color: #f4ddbc;
  border: 1px solid rgba(243, 189, 101, 0.3);
  border-radius: var(--radius-md);
  background: var(--amber-soft);
}

.notice[data-kind="error"] {
  color: #f3c4c4;
  border-color: rgba(240, 131, 131, 0.3);
  background: var(--red-soft);
}

.notice-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
}

.notice strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
}

.notice p {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
}

.text-button {
  min-height: 34px;
  padding: 0 13px;
  color: inherit;
  border: 1px solid currentColor;
  border-radius: 9px;
  background: transparent;
  font-size: 12px;
  font-weight: 720;
}

.summary {
  margin-bottom: 44px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(13, 28, 35, 0.72);
  box-shadow: var(--shadow);
}

.summary-item {
  position: relative;
  min-height: 132px;
  padding: 22px 24px;
  border-right: 1px solid var(--line);
}

.summary-item:last-child {
  border-right: 0;
}

.summary-item::after {
  position: absolute;
  top: 25px;
  right: 23px;
  width: 8px;
  height: 8px;
  content: "";
  border-radius: 50%;
  background: var(--text-muted);
}

.summary-item-good::after {
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.summary-item-warn::after {
  background: var(--amber);
  box-shadow: 0 0 0 5px var(--amber-soft);
}

.summary-item dt {
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 680;
}

.summary-item dd {
  margin: 0 0 5px;
  font-size: 34px;
  font-weight: 680;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.summary-item > span {
  color: var(--text-muted);
  font-size: 11px;
}

.fleet-section,
.detail-section {
  scroll-margin-top: 24px;
}

.section-heading,
.history-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.section-heading .eyebrow,
.history-toolbar .eyebrow {
  margin-bottom: 6px;
}

.section-heading h2,
.detail-title-row h2 {
  margin: 0;
  font-size: 27px;
  letter-spacing: -0.025em;
}

.section-note {
  margin: 0 0 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.fleet-grid,
.fleet-loading {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.fleet-card {
  position: relative;
  display: block;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  color: inherit;
  text-align: left;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(17, 36, 44, 0.96), rgba(12, 27, 34, 0.96));
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.14);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.fleet-card::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  content: "";
  background: transparent;
  transition: background 160ms ease;
}

.fleet-card:hover {
  border-color: var(--line-strong);
  background: linear-gradient(145deg, var(--panel-hover), var(--panel));
  transform: translateY(-2px);
}

.fleet-card[aria-current="true"] {
  border-color: rgba(104, 221, 167, 0.48);
}

.fleet-card[aria-current="true"]::before {
  background: var(--accent);
}

.fleet-card-inner {
  padding: 21px;
}

.fleet-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 17px;
}

.fleet-name {
  min-width: 0;
}

.fleet-name h3 {
  margin: 0 0 5px;
  overflow: hidden;
  font-size: 16px;
  font-weight: 720;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fleet-name p {
  margin: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 10px;
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 20, 25, 0.56);
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-badge::before {
  width: 6px;
  height: 6px;
  content: "";
  border-radius: 50%;
  background: var(--text-muted);
}

.status-badge[data-state="fresh"] {
  color: var(--accent-strong);
  border-color: rgba(104, 221, 167, 0.24);
  background: var(--accent-soft);
}

.status-badge[data-state="fresh"]::before {
  background: var(--accent);
}

.status-badge[data-state="stale"] {
  color: #f7cf8b;
  border-color: rgba(243, 189, 101, 0.25);
  background: var(--amber-soft);
}

.status-badge[data-state="stale"]::before {
  background: var(--amber);
}

.status-badge[data-state="unavailable"] {
  color: #efb4b4;
  border-color: rgba(240, 131, 131, 0.25);
  background: var(--red-soft);
}

.status-badge[data-state="unavailable"]::before {
  background: var(--red);
}

.card-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0 -21px;
  padding: 1px 21px;
  background: var(--line);
}

.card-metric {
  padding: 13px 0;
  background: var(--panel);
}

.card-metric:nth-child(odd) {
  padding-right: 14px;
}

.card-metric:nth-child(even) {
  padding-left: 14px;
}

.card-metric dt {
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.card-metric dd {
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.fleet-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 17px;
  color: var(--text-muted);
  font-size: 10px;
}

.fleet-card-footer time {
  font-variant-numeric: tabular-nums;
}

.fleet-card-footer .inspect {
  color: var(--text-soft);
  font-weight: 700;
}

.label-list,
.card-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.card-labels {
  min-height: 22px;
  margin-bottom: 15px;
}

.label {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  overflow: hidden;
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(6, 17, 22, 0.4);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.more-labels {
  color: var(--text-muted);
}

.skeleton-card {
  height: 280px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.skeleton-card::after {
  display: block;
  width: 100%;
  height: 100%;
  content: "";
  background: linear-gradient(105deg, transparent 25%, rgba(113, 150, 150, 0.08) 43%, transparent 62%);
  transform: translateX(-100%);
  animation: shimmer 1.5s ease infinite;
}

.empty-state {
  padding: 70px 24px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: rgba(13, 28, 35, 0.48);
}

.empty-mark {
  display: grid;
  width: 42px;
  height: 42px;
  margin: 0 auto 14px;
  place-items: center;
  color: var(--text-muted);
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  font-size: 13px;
}

.empty-state h1,
.empty-state h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.empty-state p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.detail-section {
  margin-top: 72px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}

.detail-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 30px;
  margin-bottom: 24px;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 23px;
  padding: 0;
  color: var(--text-muted);
  text-decoration: none;
  background: transparent;
  font-size: 11px;
  font-weight: 680;
}

.back-button:hover {
  color: var(--text);
}

.detail-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.server-page .detail-section {
  margin-top: 48px;
  padding-top: 0;
  border-top: 0;
}

.server-empty {
  margin-top: 72px;
}

.server-empty .back-button {
  margin: 22px 0 0;
}

.detail-title-row .eyebrow {
  margin-bottom: 5px;
}

.last-report {
  align-self: end;
  padding-bottom: 2px;
  text-align: right;
}

.last-report span,
.last-report strong {
  display: block;
}

.host-inventory {
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--panel-raised), var(--panel));
}

.host-inventory-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 19px 22px 17px;
  border-bottom: 1px solid var(--line);
}

.host-inventory-heading .eyebrow {
  margin-bottom: 4px;
}

.host-inventory-heading h2 {
  margin: 0;
  font-size: 16px;
}

.host-inventory-heading > span {
  color: var(--text-muted);
  font-size: 10px;
}

.host-inventory-empty,
.host-interface-empty {
  margin: 0;
  padding: 20px 22px;
  color: var(--text-muted);
  font-size: 12px;
}

.host-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.host-info-grid > div {
  min-width: 0;
  padding: 17px 22px;
  border-right: 1px solid var(--line);
}

.host-info-grid > div:last-child {
  border-right: 0;
}

.host-info-grid dt,
.host-interface-section h3 {
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.host-info-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

.host-interface-section {
  padding: 18px 22px 20px;
}

.host-interface-section h3 {
  margin-top: 0;
  margin-bottom: 11px;
}

.host-interface-list {
  display: grid;
  gap: 8px;
}

.host-interface-row {
  display: grid;
  grid-template-columns: minmax(80px, 130px) 1fr;
  align-items: start;
  gap: 12px;
}

.host-interface-name {
  padding-top: 4px;
  overflow-wrap: anywhere;
  color: var(--text-soft);
  font-size: 11px;
}

.host-address-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.host-address {
  max-width: 100%;
  padding: 4px 7px;
  overflow-wrap: anywhere;
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(8, 20, 25, 0.68);
  font-size: 10px;
  line-height: 1.25;
}

.last-report span {
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.last-report strong {
  font-size: 12px;
  font-weight: 640;
  font-variant-numeric: tabular-nums;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 46px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.metric-strip > div {
  padding: 20px 22px;
  border-right: 1px solid var(--line);
}

.metric-strip > div:last-child {
  border-right: 0;
}

.metric-strip dt {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-strip dd {
  margin: 0 0 5px;
  overflow: hidden;
  font-size: 25px;
  font-weight: 660;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.metric-strip span {
  color: var(--text-muted);
  font-size: 10px;
}

.history-toolbar h3 {
  margin-bottom: 5px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.history-toolbar p:last-child {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
}

.history-toolbar .history-resolution {
  min-height: 16px;
  line-height: 16px;
  transition: color 140ms ease;
}

.history-toolbar .history-resolution[data-state="loading"] {
  color: #72aef7;
}

.history-toolbar .history-resolution[data-state="waiting"] {
  color: #f7cf8b;
}

.history-toolbar .history-resolution[data-state="error"] {
  color: #efb4b4;
}

.client-traffic-heading [data-state="stale"] {
  color: #f7cf8b;
}

.history-toolbar .history-resolution[data-state="empty"] {
  color: var(--text-soft);
}

.range-switcher {
  display: inline-grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(9, 22, 27, 0.8);
}

.range-switcher button {
  min-width: 52px;
  min-height: 35px;
  padding: 0 12px;
  color: var(--text-muted);
  border-radius: 8px;
  background: transparent;
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.04em;
}

.range-switcher button:hover {
  color: var(--text);
}

.range-switcher button[aria-pressed="true"] {
  color: #072119;
  background: var(--accent);
  box-shadow: 0 4px 14px rgba(39, 140, 98, 0.18);
}

.metric-domain-tabs {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(9, 22, 27, 0.8);
}

.metric-domain-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 18px;
  color: var(--text-muted);
  border: 0;
  border-radius: 10px;
  background: transparent;
  line-height: 1;
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.metric-domain-tabs button span {
  font-size: 12px;
  font-weight: 760;
}

.metric-domain-tabs button small {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 6px;
  color: var(--text-muted);
  border-radius: 999px;
  background: rgba(114, 139, 140, 0.12);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.metric-domain-tabs button:hover {
  color: var(--text);
  background: rgba(114, 139, 140, 0.08);
}

.metric-domain-tabs button[aria-selected="true"] {
  color: #072119;
  background: var(--accent);
  box-shadow: 0 4px 14px rgba(39, 140, 98, 0.18);
}

.metric-domain-tabs button[aria-selected="true"] small {
  color: rgba(7, 33, 25, 0.72);
  background: rgba(7, 33, 25, 0.1);
}

.custom-range-dialog {
  width: min(560px, calc(100% - 32px));
  padding: 0;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #0a181d;
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.55);
}

.custom-range-dialog::backdrop {
  background: rgba(2, 8, 10, 0.72);
  backdrop-filter: blur(5px);
}

.custom-range-form {
  display: grid;
  gap: 20px;
  padding: 26px;
}

.custom-range-heading h2 {
  margin: 4px 0 8px;
  font-size: 24px;
}

.custom-range-heading > p:last-child,
.custom-range-help,
.custom-range-timezone {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}

.custom-range-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.custom-range-fields label {
  display: grid;
  gap: 8px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 720;
}

.custom-range-fields input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  background: rgba(4, 15, 18, 0.9);
  color-scheme: dark;
}

.custom-range-fields input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(104, 221, 167, 0.12);
}

.custom-range-error {
  margin: 0;
  color: #efb4b4;
  font-size: 12px;
}

.custom-range-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.custom-range-actions .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 15px;
  color: #072119;
  border: 1px solid transparent;
  border-radius: 10px;
  appearance: none;
  background: var(--accent);
  box-shadow: 0 5px 16px rgba(39, 140, 98, 0.22);
  font-size: 12px;
  font-weight: 760;
  line-height: 1;
  cursor: pointer;
  transition: transform 140ms ease, color 140ms ease, border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.custom-range-actions .button:hover:not(:disabled) {
  background: #7be4b4;
  box-shadow: 0 7px 20px rgba(39, 140, 98, 0.3);
  transform: translateY(-1px);
}

.custom-range-actions .button:active:not(:disabled) {
  box-shadow: 0 3px 10px rgba(39, 140, 98, 0.2);
  transform: translateY(0);
}

.custom-range-actions .button-secondary {
  color: var(--text-soft);
  border-color: var(--line-strong);
  background: rgba(15, 35, 41, 0.9);
  box-shadow: none;
}

.custom-range-actions .button-secondary:hover:not(:disabled) {
  color: var(--text);
  border-color: rgba(116, 153, 155, 0.82);
  background: var(--panel-raised);
  box-shadow: none;
}

.custom-range-actions .button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.chart-domain-panel[hidden] {
  display: none;
}

.client-traffic-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, var(--panel-raised), var(--panel));
}

.client-traffic-heading,
.client-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.client-traffic-heading h3,
.client-detail-heading h3 {
  margin: 3px 0 5px;
  font-size: 20px;
}

.client-traffic-heading p:last-child,
.client-detail-heading > span {
  color: var(--text-muted);
  font-size: 12px;
}

.client-traffic-table-wrap {
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.client-traffic-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 12px;
}

.client-traffic-table th,
.client-traffic-table td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.client-traffic-table th:first-child,
.client-traffic-table td:first-child {
  width: 34ch;
  min-width: 34ch;
}

.client-traffic-table th {
  color: var(--text-muted);
  background: rgba(7, 17, 22, 0.52);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.client-traffic-table tr:last-child td {
  border-bottom: 0;
}

.client-traffic-table tr[data-selected="true"] td {
  background: rgba(104, 221, 167, 0.07);
}

.client-traffic-table tr[data-activity="inactive"] td,
.client-traffic-table tr[data-activity="unknown"] td {
  color: var(--text-muted);
}

.client-id-button {
  padding: 0;
  color: var(--accent);
  border: 0;
  background: transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: inherit;
  font-weight: 720;
  text-align: left;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  cursor: pointer;
}

.client-direction-value {
  display: grid;
  gap: 3px;
  white-space: nowrap;
}

.client-direction-total {
  color: var(--text-muted);
  font-size: 10px;
}

.client-address-list,
.client-session-list {
  display: grid;
  gap: 3px;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.client-activity-label {
  width: fit-content;
  padding: 2px 6px;
  color: var(--accent);
  background: rgba(104, 221, 167, 0.1);
  border: 1px solid rgba(104, 221, 167, 0.24);
  border-radius: 999px;
  font-family: inherit;
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.client-activity-label[data-state="inactive"],
.client-activity-label[data-state="unknown"] {
  color: var(--text-muted);
  background: rgba(119, 143, 151, 0.08);
  border-color: var(--line-strong);
}

.client-traffic-empty {
  margin-top: 18px;
  padding: 26px;
  color: var(--text-muted);
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
}

.client-traffic-detail {
  display: grid;
  gap: 18px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.client-identity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.client-identity-grid > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(7, 17, 22, 0.35);
}

.client-identity-grid dt {
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
}

.client-identity-grid dd {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.client-traffic-charts .chart-card {
  padding-inline: 16px;
}

.chart-card-wide {
  grid-column: 1 / -1;
}

.chart-card {
  min-width: 0;
  padding: 20px 20px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, var(--panel-raised), var(--panel));
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
}

.chart-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.chart-heading h3,
.chart-heading h4 {
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 720;
}

.chart-heading p {
  margin: 0;
  color: var(--text-muted);
  font-size: 10px;
}

.chart-heading strong {
  flex: 0 0 auto;
  font-size: 17px;
  font-weight: 670;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.chart-heading .chart-range-summary {
  max-width: 70%;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.55;
  text-align: right;
  white-space: pre-line;
}

.chart {
  position: relative;
  min-height: 244px;
  overflow: hidden;
}

.metric-chart {
  display: block;
  width: 100%;
  height: 205px;
  overflow: visible;
  touch-action: none;
}

.chart-grid-line {
  stroke: rgba(87, 119, 123, 0.22);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart-axis-label {
  fill: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
}

.chart-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.chart-line.secondary {
  stroke-width: 1.5;
  stroke-dasharray: 5 5;
  opacity: 0.8;
}

.chart-area {
  opacity: 0.09;
}

.chart-hover-line {
  pointer-events: none;
  stroke: rgba(232, 247, 242, 0.58);
  stroke-dasharray: 3 4;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart-hover-marker {
  pointer-events: none;
  stroke: #071116;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.chart-hit-area {
  cursor: crosshair;
  fill: transparent;
  outline: none;
  pointer-events: all;
}

.chart-hit-area:focus {
  stroke: rgba(104, 221, 167, 0.42);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  top: 10px;
  width: max-content;
  min-width: 178px;
  max-width: min(260px, calc(100% - 16px));
  padding: 11px 12px;
  color: var(--text);
  border: 1px solid rgba(116, 153, 155, 0.44);
  border-radius: 11px;
  background: rgba(6, 17, 22, 0.96);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.38);
  pointer-events: none;
  transform: translateX(10px);
  backdrop-filter: blur(10px);
}

.chart-tooltip[data-side="left"] {
  transform: translateX(calc(-100% - 10px));
}

.chart-tooltip-time {
  display: block;
  margin-bottom: 8px;
  color: var(--text-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.chart-tooltip-values {
  display: grid;
  gap: 5px;
  margin: 0;
}

.chart-tooltip-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.chart-tooltip-row dt,
.chart-tooltip-row dd {
  margin: 0;
  font-size: 10px;
}

.chart-tooltip-row dt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--text-muted);
}

.chart-tooltip-row dd {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.chart-tooltip-swatch {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(100%, 430px);
  padding: 0;
}

.login-card {
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(17, 36, 44, 0.98), rgba(10, 23, 29, 0.98));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.32);
}

.login-brand {
  margin-bottom: 34px;
}

.login-card h1 {
  margin: 0;
  font-size: clamp(29px, 8vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.login-copy {
  margin: 16px 0 30px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.65;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form label {
  margin-top: 7px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 720;
}

.login-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  outline: none;
  background: rgba(5, 15, 19, 0.7);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.login-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.login-error {
  margin: 7px 0 0;
  padding: 11px 12px;
  color: #ffd4d4;
  border: 1px solid rgba(240, 131, 131, 0.3);
  border-radius: 10px;
  background: var(--red-soft);
  font-size: 12px;
  line-height: 1.45;
}

.login-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 49px;
  margin-top: 12px;
  padding: 0 17px;
  color: #052018;
  border: 0;
  border-radius: 11px;
  background: var(--accent);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  transition: background 140ms ease, transform 140ms ease;
}

.login-submit:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.login-submit:disabled {
  cursor: progress;
  opacity: 0.64;
  transform: none;
}

.login-security {
  margin: 26px 0 0;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}

.login-security span {
  margin-right: 6px;
  color: var(--accent);
  font-size: 8px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  min-height: 22px;
  margin-top: 4px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 680;
}

.legend-swatch {
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.chart-empty {
  display: grid;
  height: 205px;
  place-items: center;
  color: var(--text-muted);
  border: 1px dashed var(--line);
  border-radius: 12px;
  font-size: 11px;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 90px;
  color: var(--text-muted);
  border-top: 1px solid rgba(98, 132, 136, 0.2);
  font-size: 10px;
}

footer p {
  margin: 0;
}

.footer-lock {
  display: inline-block;
  margin-right: 7px;
  color: var(--accent);
  font-size: 7px;
  vertical-align: 1px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  border: 0 !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
}

.noscript-message {
  position: fixed;
  z-index: 1000;
  right: 20px;
  bottom: 20px;
  left: 20px;
  padding: 16px;
  color: #301d03;
  text-align: center;
  border-radius: 12px;
  background: var(--amber);
  font-size: 13px;
  font-weight: 700;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(104, 221, 167, 0.48);
  outline-offset: 3px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  50% { opacity: 0.42; }
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

@media (max-width: 1100px) {
  .fleet-grid,
  .fleet-loading {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .app-shell {
    padding: 0 22px;
  }

  main {
    padding-top: 48px;
  }

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

  .summary-item:nth-child(2),
  .metric-strip > div:nth-child(2) {
    border-right: 0;
  }

  .summary-item:nth-child(-n + 2),
  .metric-strip > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .detail-header {
    grid-template-columns: 1fr;
  }

  .host-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .host-info-grid > div:nth-child(2) {
    border-right: 0;
  }

  .host-info-grid > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .last-report {
    text-align: left;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .client-identity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .app-shell {
    padding: 0 15px;
  }

  .topbar {
    min-height: 72px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .connection-state {
    min-height: 34px;
    padding: 0 10px;
  }

  .icon-button {
    width: 38px;
    min-height: 38px;
    padding: 0;
  }

  .button-label {
    display: none;
  }

  main {
    padding-top: 38px;
  }

  .intro,
  .section-heading,
  .history-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .intro {
    margin-bottom: 25px;
  }

  .updated-at {
    margin: 0;
  }

  .notice {
    grid-template-columns: auto 1fr;
  }

  .notice .text-button {
    grid-column: 1 / -1;
  }

  .summary {
    margin-bottom: 38px;
  }

  .summary-item {
    min-height: 116px;
    padding: 18px;
  }

  .summary-item::after {
    top: 21px;
    right: 18px;
  }

  .summary-item dd {
    font-size: 28px;
  }

  .fleet-grid,
  .fleet-loading {
    grid-template-columns: 1fr;
  }

  .skeleton-card {
    height: 270px;
  }

  .detail-section {
    margin-top: 55px;
  }

  .detail-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .host-inventory-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    padding: 17px;
  }

  .host-info-grid {
    grid-template-columns: 1fr;
  }

  .host-info-grid > div,
  .host-info-grid > div:nth-child(2) {
    padding: 15px 17px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .host-info-grid > div:last-child {
    border-bottom: 0;
  }

  .host-interface-section {
    padding: 17px;
  }

  .host-interface-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .metric-strip {
    margin-bottom: 38px;
  }

  .metric-strip > div {
    padding: 17px;
  }

  .metric-strip dd {
    font-size: 20px;
  }

  .range-switcher {
    width: 100%;
  }

  .metric-domain-tabs {
    width: 100%;
  }

  .metric-domain-tabs button {
    min-width: 0;
    padding: 0 10px;
  }

  .range-switcher button {
    min-width: 0;
    padding: 0 8px;
  }

  .chart-card {
    padding: 17px 14px 14px;
  }

  .chart-heading {
    gap: 10px;
  }

  .chart-heading strong {
    font-size: 14px;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
  }

  .login-page {
    padding: 15px;
  }

  .custom-range-form {
    padding: 22px 18px;
  }

  .custom-range-fields {
    grid-template-columns: 1fr;
  }

  .custom-range-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .client-identity-grid {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 30px 22px;
  }
}

@media (max-width: 390px) {
  .connection-state span:last-child {
    max-width: 82px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .summary-item {
    min-height: 110px;
    padding: 15px;
  }

  .summary-item::after {
    display: none;
  }

  .summary-item > span {
    font-size: 9px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
