:root {
  color-scheme: light;
  --bg: #eef2f8;
  --text: #101827;
  --muted: #64748b;
  --soft: #334155;
  --line: rgba(15, 23, 42, 0.1);
  --line-strong: rgba(15, 23, 42, 0.18);
  --white: rgba(255, 255, 255, 0.82);
  --cyan: #06b6d4;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --violet: #8b5cf6;
  --blue: #2563eb;
  --pink: #ec4899;
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.13);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    linear-gradient(115deg, rgba(20, 184, 166, 0.16), transparent 26%),
    linear-gradient(245deg, rgba(236, 72, 153, 0.14), transparent 24%),
    linear-gradient(165deg, rgba(245, 158, 11, 0.16), transparent 22%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f8 52%, #e7edf6 100%);
  background-size: 160% 160%, 150% 150%, 170% 170%, auto;
  animation: pageColorFlow 18s ease-in-out infinite alternate;
}

body.theme-dark {
  color-scheme: dark;
  --bg: #0b1220;
  --text: #edf5ff;
  --muted: #9aabc1;
  --soft: #c8d6e8;
  --line: rgba(226, 232, 240, 0.12);
  --line-strong: rgba(226, 232, 240, 0.2);
  --white: rgba(15, 23, 42, 0.82);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  background:
    linear-gradient(115deg, rgba(6, 182, 212, 0.16), transparent 26%),
    linear-gradient(245deg, rgba(236, 72, 153, 0.13), transparent 24%),
    linear-gradient(165deg, rgba(245, 158, 11, 0.1), transparent 22%),
    linear-gradient(180deg, #070c15 0%, #0d1626 54%, #111827 100%);
  background-size: 160% 160%, 150% 150%, 170% 170%, auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.78), transparent 72%);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  min-height: 100vh;
  min-width: 0;
}

.rail {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 100vh;
  padding: 18px 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(9, 16, 28, 0.92);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.rail-stack,
.rail-actions {
  display: grid;
  gap: 10px;
}

.rail-actions {
  margin-top: auto;
}

.rail-mark,
.rail-btn {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
}

.rail-mark {
  border: 0;
  background: linear-gradient(135deg, #06b6d4, #7c3aed 48%, #f97316);
  color: white;
  font-weight: 800;
  box-shadow: 0 16px 36px rgba(124, 58, 237, 0.26);
  animation: hueBreathe 9s linear infinite;
  cursor: pointer;
}

.rail-btn {
  position: relative;
  border: 1px solid transparent;
  color: #9aa9bd;
  background: transparent;
  cursor: pointer;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.rail-btn:hover,
.rail-btn.active {
  color: white;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.12);
}

.rail-btn:hover {
  transform: translateY(-1px);
}

.rail-btn.has-alert::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border: 2px solid rgba(9, 16, 28, 0.92);
  border-radius: 50%;
  background: var(--amber);
}

.rail-btn.bottom {
  margin-top: auto;
}

.rail-glyph {
  font-size: 18px;
  line-height: 1;
}

.workspace {
  width: 100%;
  max-width: 1760px;
  min-width: 0;
  margin: 0 auto;
  padding: clamp(16px, 1.8vw, 28px);
}

.topbar {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(176px, 228px) minmax(0, 1fr) max-content;
  gap: clamp(18px, 2vw, 34px);
  align-items: center;
  padding: 18px clamp(18px, 1.6vw, 26px);
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.76)),
    rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  scroll-margin-top: 24px;
}

.title-stack,
.command-center,
.search-box,
.map-panel,
.health-panel,
.metric-card,
.quick-tile {
  min-width: 0;
}

.title-stack {
  max-width: 228px;
  overflow: hidden;
}

body.theme-dark .topbar,
body.theme-dark .health-panel,
body.theme-dark .homepage-nav-panel,
body.theme-dark .project-group {
  border-color: rgba(148, 163, 184, 0.22);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.78)),
    rgba(15, 23, 42, 0.82);
}

body.theme-dark .search-box,
body.theme-dark .filter-chip,
body.theme-dark .icon-btn,
body.theme-dark .metric-card,
body.theme-dark .quick-tile,
body.theme-dark .nav-source-group,
body.theme-dark .nav-entry,
body.theme-dark .project-card {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.72);
}

body.theme-dark .search-box input,
body.theme-dark .project-title strong,
body.theme-dark .nav-entry-main strong,
body.theme-dark .metric-card strong {
  color: var(--text);
}

body.theme-dark kbd,
body.theme-dark .tag {
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(226, 232, 240, 0.06);
}

.topbar::before,
.project-group::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, #06b6d4, #22c55e, #f59e0b, #ec4899, #2563eb, #06b6d4);
  background-size: 220% 100%;
  animation: accentSlide 8s linear infinite;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 3vw, 46px);
  line-height: 1.05;
  letter-spacing: 0;
}

.brand-title {
  display: block;
  margin: 0;
  width: 100%;
  max-width: 100%;
  line-height: 0.96;
}

.brand-title span {
  display: block;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.brand-title > span:first-child {
  font-size: clamp(28px, 1.7vw, 36px);
  font-weight: 850;
}

.brand-title > span:last-child {
  color: #334155;
  font-size: clamp(18px, 1.05vw, 23px);
  font-weight: 800;
}

body.theme-dark .brand-title > span:last-child {
  color: #c8d6e8;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 16px;
}

.command-center {
  display: grid;
  gap: 12px;
}

.search-box {
  min-height: 52px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  padding: 0 10px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.72),
    0 14px 36px rgba(37, 99, 235, 0.08);
}

.search-icon {
  color: var(--cyan);
  font-size: 21px;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 15px;
}

.search-box input::placeholder {
  color: #8a97aa;
}

kbd {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 4px 8px;
  color: #475569;
  background: rgba(15, 23, 42, 0.04);
  font-size: 12px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.68);
  padding: 0 12px;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.filter-chip:hover,
.filter-chip.active {
  color: var(--text);
  border-color: rgba(6, 182, 212, 0.46);
  background: rgba(6, 182, 212, 0.12);
  box-shadow: 0 10px 24px rgba(6, 182, 212, 0.08);
  transform: translateY(-1px);
}

.status-strip {
  justify-self: end;
  min-width: max-content;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  color: var(--soft);
  font-size: 14px;
  white-space: nowrap;
}

.divider {
  width: 1px;
  height: 18px;
  background: var(--line-strong);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
}

.status-dot.ok {
  background: var(--green);
}

.status-dot.warn {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1);
}

.status-dot.danger {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.status-dot.info {
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(340px, 0.72fr);
  gap: 18px;
  margin-top: 18px;
}

.map-panel,
.health-panel,
.project-group,
.homepage-nav-panel,
.quick-tile {
  border-radius: 12px;
  backdrop-filter: blur(20px);
}

.map-panel,
.health-panel,
.homepage-nav-panel,
.project-group {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.78)),
    rgba(255, 255, 255, 0.82);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.1);
}

.map-panel,
.health-panel {
  padding: 18px;
}

#servers-section,
#monitor-section,
.quick-access,
.homepage-nav-panel,
.project-board {
  scroll-margin-top: 24px;
}

.map-panel {
  color: #eef7ff;
  border-color: rgba(15, 23, 42, 0.18);
  background:
    linear-gradient(135deg, rgba(11, 18, 32, 0.96), rgba(13, 28, 43, 0.92)),
    #0b1220;
}

.map-panel .eyebrow,
.map-panel .region-summary span {
  color: #9fb2c8;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 14px;
  min-width: 0;
}

.panel-head > div {
  min-width: 0;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(34, 197, 94, 0.32);
  border-radius: 8px;
  padding: 8px 10px;
  color: #b8ffd0;
  background: rgba(34, 197, 94, 0.09);
  font-size: 13px;
  white-space: nowrap;
}

.world-map {
  position: relative;
  isolation: isolate;
  height: 360px;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  touch-action: none;
  overscroll-behavior: contain;
  border: 1px solid rgba(6, 182, 212, 0.22);
  border-radius: 10px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(115deg, rgba(6, 182, 212, 0.12), transparent 34%),
    linear-gradient(245deg, rgba(236, 72, 153, 0.1), transparent 38%),
    #07111f;
  background-size: 56px 56px, 56px 56px, auto, auto, auto;
}

.world-map::before {
  content: "";
  position: absolute;
  inset: -20%;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 42%, rgba(45, 212, 255, 0.2), transparent 58%);
  animation: mapScan 6s ease-in-out infinite;
}

.world-map::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(7, 17, 31, 0.86) 0%, transparent 20%, transparent 78%, rgba(7, 17, 31, 0.76) 100%),
    linear-gradient(0deg, rgba(7, 17, 31, 0.7), transparent 24%, transparent 72%, rgba(7, 17, 31, 0.46));
}

.world-map.is-dragging {
  cursor: grabbing;
}

.map-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.map-points {
  position: absolute;
  inset: 0;
  z-index: 5;
  transform-origin: 0 0;
  transform: translate3d(0, 0, 0) scale(1);
  will-change: transform;
  backface-visibility: hidden;
  pointer-events: none;
}

.route-layer {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  z-index: 4;
  overflow: visible;
  pointer-events: none;
}

.route-label-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.real-world-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  opacity: 0.86;
  filter:
    drop-shadow(0 16px 36px rgba(45, 212, 255, 0.1))
    saturate(1.08);
  pointer-events: none;
  user-select: none;
  transform: translateZ(0);
  shape-rendering: geometricPrecision;
  text-rendering: geometricPrecision;
}

.map-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: radial-gradient(circle, rgba(45, 212, 255, 0.2) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.16;
}

.node-dot {
  position: absolute;
  border: 0;
  color: #eef7ff;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transform: translate(-12px, -12px);
  cursor: pointer;
  pointer-events: auto;
}

.route-hop-label {
  position: absolute;
  left: 0;
  top: 0;
  border: 1px solid var(--route-color, rgba(45, 212, 255, 0.5));
  border-radius: 8px;
  padding: 6px 9px;
  color: #e8f8ff;
  background: rgba(7, 17, 31, 0.78);
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.22),
    0 0 20px var(--route-glow, rgba(45, 212, 255, 0.26));
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  backdrop-filter: blur(12px);
  transition:
    opacity 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.route-hop-label.is-muted {
  opacity: 0.26;
}

.route-hop-label.is-active {
  border-color: rgba(248, 253, 255, 0.92);
  background: rgba(7, 17, 31, 0.9);
}

.map-controls {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 6;
  display: flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(148, 235, 255, 0.18);
  border-radius: 10px;
  background: rgba(7, 17, 31, 0.72);
  backdrop-filter: blur(14px);
}

.map-controls button {
  min-width: 34px;
  height: 32px;
  border: 1px solid rgba(148, 235, 255, 0.2);
  border-radius: 8px;
  color: #eef7ff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.map-controls button:hover {
  border-color: rgba(45, 212, 255, 0.68);
  background: rgba(45, 212, 255, 0.16);
}

.map-zoom-label {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 6;
  border: 1px solid rgba(148, 235, 255, 0.18);
  border-radius: 8px;
  padding: 6px 9px;
  color: #bfeeff;
  background: rgba(7, 17, 31, 0.72);
  backdrop-filter: blur(14px);
  font-size: 12px;
}

.node-dot span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow:
    0 0 0 8px rgba(45, 212, 255, 0.1),
    0 0 30px rgba(45, 212, 255, 0.56);
  animation: nodePulse 2.8s ease-in-out infinite;
}

.node-dot strong {
  border: 1px solid rgba(148, 235, 255, 0.28);
  border-radius: 6px;
  padding: 5px 8px;
  background: rgba(7, 17, 31, 0.86);
  font-size: 12px;
  white-space: nowrap;
}

.node-dot:hover strong {
  border-color: rgba(45, 212, 255, 0.7);
}

.node-dot.is-route-active span {
  box-shadow:
    0 0 0 10px rgba(45, 212, 255, 0.2),
    0 0 36px rgba(45, 212, 255, 0.82);
}

.node-dot.is-route-active strong {
  border-color: rgba(45, 212, 255, 0.84);
  color: #f8fdff;
  background: rgba(8, 24, 42, 0.94);
}

.route-group {
  opacity: 0.9;
  transition: opacity 180ms ease;
}

.route-group.is-muted {
  opacity: 0.18;
}

.route-group.is-active {
  opacity: 1;
}

.route-shadow,
.route-path,
.route-pulse {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.route-shadow {
  stroke: rgba(3, 8, 18, 0.72);
  stroke-width: 1.5;
}

.route-path {
  stroke: var(--route-color, #38bdf8);
  stroke-width: 0.46;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 7px var(--route-glow, rgba(56, 189, 248, 0.48)));
}

.route-pulse {
  stroke: rgba(255, 255, 255, 0.88);
  stroke-width: 0.34;
  stroke-linecap: round;
  stroke-dasharray: 2.2 5.6;
  animation: routeFlow 1.15s linear infinite;
}

.route-particle {
  fill: #f8fdff;
  filter: drop-shadow(0 0 7px var(--route-glow, rgba(56, 189, 248, 0.72)));
}

.node-dot.hk {
  flex-direction: row-reverse;
}

.node-dot.home {
  flex-direction: column-reverse;
  gap: 6px;
  transform: translate(-50%, -28px);
}

.node-dot.hk span,
.node-dot.tw span {
  background: var(--green);
  box-shadow:
    0 0 0 8px rgba(34, 197, 94, 0.1),
    0 0 30px rgba(34, 197, 94, 0.48);
}

.node-dot.fr span {
  background: var(--pink);
  box-shadow:
    0 0 0 8px rgba(236, 72, 153, 0.1),
    0 0 30px rgba(236, 72, 153, 0.48);
}

.node-dot.vn span {
  background: var(--amber);
  box-shadow:
    0 0 0 8px rgba(245, 158, 11, 0.1),
    0 0 30px rgba(245, 158, 11, 0.48);
}

.node-dot.home span {
  width: 20px;
  height: 20px;
  background: #f8fdff;
  box-shadow:
    0 0 0 9px rgba(56, 189, 248, 0.16),
    0 0 34px rgba(248, 253, 255, 0.68);
}

.node-dot.home strong {
  border-color: rgba(248, 253, 255, 0.5);
  color: #07111f;
  background: rgba(248, 253, 255, 0.92);
}

.region-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.region-summary span {
  border: 1px solid rgba(148, 235, 255, 0.16);
  border-radius: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
}

.server-detail {
  margin-top: 12px;
  border: 1px solid rgba(148, 235, 255, 0.16);
  border-radius: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.server-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.server-detail h3 {
  color: #eef7ff;
}

.route-mode-pill {
  border: 1px solid rgba(45, 212, 255, 0.22);
  border-radius: 8px;
  padding: 6px 9px;
  color: #bfeeff;
  background: rgba(45, 212, 255, 0.08);
  font-size: 12px;
  white-space: nowrap;
}

.detail-columns {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(280px, 1.15fr);
  gap: 12px;
  margin-top: 12px;
}

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

.route-detail-list {
  display: grid;
  gap: 10px;
}

.server-row,
.route-detail-card {
  min-width: 0;
  border: 1px solid rgba(148, 235, 255, 0.14);
  border-radius: 9px;
  padding: 10px 12px;
  background: rgba(7, 17, 31, 0.48);
  display: grid;
  gap: 7px;
}

.route-detail-card {
  background:
    linear-gradient(135deg, var(--route-card-tint, rgba(45, 212, 255, 0.12)), transparent 58%),
    rgba(7, 17, 31, 0.48);
}

.route-detail-head,
.route-detail-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.route-detail-head strong {
  min-width: 0;
  overflow: hidden;
  color: #eef7ff;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.route-detail-head span {
  border: 1px solid var(--route-card-line, rgba(45, 212, 255, 0.32));
  border-radius: 999px;
  padding: 4px 7px;
  color: #e8f8ff;
  background: rgba(7, 17, 31, 0.5);
  font-size: 12px;
  white-space: nowrap;
}

.route-detail-meta {
  color: #9fb2c8;
  font-size: 12px;
}

.server-row strong,
.server-row code,
.server-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-row strong {
  color: #eef7ff;
  font-size: 14px;
}

.server-row code {
  color: #9ee9ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.server-row span,
.server-placeholder {
  color: #9fb2c8;
  font-size: 12px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.68);
  cursor: pointer;
}

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

.metric-card {
  min-height: 102px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.72);
}

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

.metric-card strong {
  display: block;
  margin: 8px 0 2px;
  font-size: 34px;
  line-height: 1;
}

.metric-card small {
  color: #16a34a;
}

.metric-card.warn small {
  color: var(--amber);
}

.alert-list {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.alert-list div {
  min-height: 42px;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  color: var(--soft);
  font-size: 14px;
}

.alert-list span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-list time {
  color: var(--muted);
  font-size: 12px;
}

.quick-access {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.quick-tile {
  min-height: 76px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  padding: 12px;
  background: rgba(255, 255, 255, 0.76);
  display: flex;
  align-items: center;
  gap: 12px;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.quick-tile > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-tile:hover {
  border-color: rgba(6, 182, 212, 0.42);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.1);
  transform: translateY(-2px);
}

.homepage-nav-panel {
  position: relative;
  overflow: hidden;
  margin-top: 18px;
  padding: 16px;
}

.homepage-nav-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, #2563eb, #06b6d4, #22c55e, #f59e0b, #ec4899);
  background-size: 220% 100%;
  animation: accentSlide 8s linear infinite;
}

.source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid rgba(6, 182, 212, 0.24);
  border-radius: 8px;
  padding: 0 10px;
  color: #0369a1;
  background: rgba(6, 182, 212, 0.08);
  font-size: 13px;
  white-space: nowrap;
}

.homepage-nav-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.nav-source-group {
  min-width: 0;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.62);
}

.nav-source-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.nav-source-head strong {
  font-size: 14px;
}

.nav-source-head span {
  color: var(--muted);
  font-size: 12px;
}

.nav-entry-list {
  display: grid;
  gap: 8px;
}

.nav-entry {
  min-width: 0;
  min-height: 54px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 9px;
  padding: 8px 10px;
  background:
    linear-gradient(135deg, var(--project-tint, rgba(6, 182, 212, 0.08)), transparent 46%),
    rgba(255, 255, 255, 0.72);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.nav-entry:hover {
  border-color: var(--project-line, rgba(6, 182, 212, 0.42));
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.nav-entry-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 11px;
  font-weight: 800;
}

.nav-entry-main {
  min-width: 0;
}

.nav-entry-main strong,
.nav-entry-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-entry-main strong {
  font-size: 13px;
}

.nav-entry-main small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.quick-icon,
.project-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex: none;
  color: white;
  font-size: 12px;
  font-weight: 800;
}

.finance {
  background: linear-gradient(135deg, #2563eb, #16a34a);
}

.apple {
  background: linear-gradient(135deg, #2563eb, #8b5cf6);
}

.stock {
  background: linear-gradient(135deg, #16a34a, #f59e0b);
}

.node {
  background: linear-gradient(135deg, #0891b2, #2563eb);
}

.ai {
  background: linear-gradient(135deg, #7c3aed, #ec4899);
}

.ops,
.local {
  background: linear-gradient(135deg, #475569, #f59e0b);
}

.project-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
  padding-bottom: 32px;
}

.project-group {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 16px;
}

.project-group::before {
  height: 2px;
}

.group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.group-count {
  color: var(--muted);
  font-size: 13px;
}

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

.project-card {
  position: relative;
  min-height: 156px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(248, 250, 252, 0.78)),
    rgba(255, 255, 255, 0.82);
  display: grid;
  gap: 12px;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  background: linear-gradient(135deg, var(--project-tint, rgba(6, 182, 212, 0.14)), transparent 38%);
  transition: opacity 180ms ease;
}

.project-card:hover {
  border-color: var(--project-line, rgba(6, 182, 212, 0.42));
  transform: translateY(-3px);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.12);
}

.project-card:hover::before {
  opacity: 1;
}

.project-top,
.project-desc,
.sparkline,
.project-footer {
  position: relative;
  z-index: 1;
}

.project-top {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.project-title {
  min-width: 0;
}

.project-title strong,
.project-title span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-title strong {
  font-size: 15px;
}

.project-title span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.project-desc {
  min-height: 38px;
  margin: 0;
  color: var(--soft);
  line-height: 1.55;
  font-size: 13px;
}

.sparkline {
  width: 100%;
  height: 36px;
}

.sparkline polyline {
  fill: none;
  stroke: var(--project-line, var(--green));
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 230;
  stroke-dashoffset: 230;
  animation: drawLine 1.2s ease forwards;
}

.project-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 6px;
  padding: 5px 7px;
  color: #475569;
  background: rgba(15, 23, 42, 0.035);
  font-size: 12px;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 180px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.accent-finance {
  --project-line: #16a34a;
  --project-tint: rgba(34, 197, 94, 0.16);
}

.accent-apple {
  --project-line: #8b5cf6;
  --project-tint: rgba(139, 92, 246, 0.14);
}

.accent-ai {
  --project-line: #ec4899;
  --project-tint: rgba(236, 72, 153, 0.13);
}

.accent-node {
  --project-line: #06b6d4;
  --project-tint: rgba(6, 182, 212, 0.15);
}

.accent-ops {
  --project-line: #f59e0b;
  --project-tint: rgba(245, 158, 11, 0.16);
}

@keyframes pageColorFlow {
  0% {
    background-position: 0% 20%, 100% 20%, 30% 0%, 0 0;
  }
  100% {
    background-position: 80% 70%, 18% 86%, 90% 60%, 0 0;
  }
}

@keyframes accentSlide {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 220% 50%;
  }
}

@keyframes mapScan {
  0% {
    transform: translateX(-24%) translateY(12%);
    opacity: 0;
  }
  45%,
  58% {
    opacity: 1;
  }
  100% {
    transform: translateX(24%) translateY(-12%);
    opacity: 0;
  }
}

@keyframes nodePulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.18);
  }
}

@keyframes hueBreathe {
  0% {
    filter: hue-rotate(0deg);
  }
  100% {
    filter: hue-rotate(360deg);
  }
}

@keyframes drawLine {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes routeFlow {
  to {
    stroke-dashoffset: -15.6;
  }
}

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

@media (max-width: 1180px) {
  .topbar,
  .hero-grid,
  .project-board {
    grid-template-columns: 1fr;
  }

  .homepage-nav-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-strip {
    justify-self: start;
  }

  .quick-access {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .rail {
    position: fixed;
    inset: auto 10px max(10px, env(safe-area-inset-bottom)) 10px;
    z-index: 30;
    height: 64px;
    padding: 8px 10px;
    flex-direction: row;
    justify-content: flex-start;
    overflow-x: auto;
    border-right: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    box-shadow: 0 18px 42px rgba(9, 16, 28, 0.26);
  }

  .rail-stack,
  .rail-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
  }

  .rail-actions {
    margin-top: 0;
    margin-left: 0;
  }

  .rail-btn.bottom {
    margin-top: 0;
    margin-left: 0;
  }

  .rail-mark,
  .rail-btn {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }

  .workspace {
    padding: 12px 12px calc(94px + env(safe-area-inset-bottom));
  }

  .topbar {
    gap: 14px;
    padding: 16px;
    border-radius: 16px;
  }

  .title-stack {
    display: grid;
    gap: 2px;
  }

  h1 {
    font-size: clamp(30px, 9vw, 40px);
  }

  h2 {
    font-size: 20px;
  }

  .status-strip {
    min-height: 0;
    font-size: 13px;
  }

  .command-center {
    gap: 10px;
  }

  .search-box {
    min-height: 48px;
    grid-template-columns: 34px minmax(0, 1fr);
    border-radius: 12px;
  }

  .search-box input {
    font-size: 14px;
  }

  .filter-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .filter-row::-webkit-scrollbar {
    display: none;
  }

  .filter-chip {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 14px;
  }

  kbd {
    display: none;
  }

  .hero-grid {
    margin-top: 14px;
    gap: 14px;
  }

  .map-panel,
  .health-panel,
  .project-group {
    border-radius: 16px;
  }

  .map-panel,
  .health-panel {
    padding: 14px;
  }

  .panel-head {
    align-items: center;
    gap: 10px;
  }

  .live-pill {
    padding: 7px 9px;
    font-size: 12px;
  }

  .world-map {
    height: min(74vw, 320px);
    min-height: 260px;
    border-radius: 14px;
  }

  .map-controls {
    right: 10px;
    top: 10px;
    gap: 5px;
    padding: 5px;
    border-radius: 12px;
  }

  .map-controls button {
    min-width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .map-zoom-label {
    right: 10px;
    bottom: 10px;
    border-radius: 10px;
  }

  .node-dot {
    gap: 6px;
  }

  .node-dot span {
    width: 16px;
    height: 16px;
  }

  .node-dot strong {
    padding: 4px 7px;
    font-size: 11px;
  }

  .region-summary {
    gap: 7px;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .region-summary::-webkit-scrollbar {
    display: none;
  }

  .region-summary span {
    flex: 0 0 auto;
    padding: 7px 10px;
  }

  .server-detail {
    padding: 12px;
    border-radius: 14px;
  }

  .quick-access,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .project-list,
  .detail-columns,
  .server-list {
    grid-template-columns: 1fr;
  }

  .quick-access,
  .homepage-nav-panel,
  .project-board {
    margin-top: 14px;
  }

  .homepage-nav-board {
    grid-template-columns: 1fr;
  }

  .homepage-nav-panel {
    padding: 14px;
    border-radius: 16px;
  }

  .quick-tile {
    min-height: 74px;
    padding: 10px;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    border-radius: 14px;
    font-size: 13px;
  }

  .quick-icon,
  .project-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .metric-card {
    min-height: 96px;
    border-radius: 14px;
  }

  .metric-card strong {
    font-size: 30px;
  }

  .alert-list div {
    grid-template-columns: 14px minmax(0, 1fr);
    min-height: 40px;
  }

  .alert-list time {
    grid-column: 2;
  }

  .project-group {
    padding: 14px;
  }

  .project-board {
    gap: 14px;
  }

  .project-card {
    min-height: 142px;
    border-radius: 14px;
  }

  .project-desc {
    min-height: auto;
  }

  .sparkline {
    height: 30px;
  }

  .server-row {
    border-radius: 12px;
  }
}

@media (max-width: 430px) {
  .workspace {
    padding-inline: 10px;
  }

  .topbar {
    padding: 14px;
  }

  .rail {
    inset-inline: 8px;
    gap: 6px;
  }

  .rail-mark,
  .rail-btn {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .search-box input::placeholder {
    font-size: 13px;
  }

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

  .quick-tile {
    min-height: 70px;
  }

  .world-map {
    height: 272px;
    min-height: 252px;
  }

  .node-dot strong {
    font-size: 10px;
  }

  .metric-grid {
    gap: 8px;
  }

  .project-top {
    grid-template-columns: 36px minmax(0, 1fr) auto;
  }
}
