:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #101820;
  background: #f5f7fb;
}

body {
  margin: 0;
}

a {
  color: #0a66c2;
  text-decoration: none;
}

.hero {
  min-height: 54vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px clamp(20px, 6vw, 88px);
  color: #fff;
  background:
    linear-gradient(rgba(9, 20, 36, 0.42), rgba(9, 20, 36, 0.72)),
    url("https://images.unsplash.com/photo-1516321318423-f06f85e504b3?auto=format&fit=crop&w=1800&q=82") center/cover;
}

nav {
  position: absolute;
  top: 24px;
  left: clamp(20px, 6vw, 88px);
  right: clamp(20px, 6vw, 88px);
  display: flex;
  align-items: center;
  gap: 22px;
}

nav strong {
  margin-right: auto;
}

nav a {
  color: #fff;
}

h1 {
  max-width: 860px;
  margin: 0 0 18px;
  font-size: clamp(40px, 7vw, 78px);
  line-height: 1.02;
}

.hero p {
  max-width: 720px;
  margin: 0;
  font-size: 20px;
  line-height: 1.6;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 42px 20px 80px;
}

section {
  padding: 28px 0;
  border-bottom: 1px solid #dce3ed;
}

h2 {
  margin: 0 0 16px;
  font-size: 24px;
}

li {
  margin: 10px 0;
}

pre {
  overflow: auto;
  padding: 18px;
  border-radius: 8px;
  background: #111820;
  color: #d8f4ff;
  line-height: 1.45;
}

.admin-page {
  background: #f4f6f8;
}

.admin-header {
  min-height: 90px;
  background: #101820;
  color: #fff;
}

.admin-main h1 {
  margin: 0;
  font-size: 32px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: #0a66c2;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
}

.metrics article {
  border: 1px solid #dce3ed;
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.metrics strong {
  display: block;
  font-size: 30px;
}

.metrics span {
  color: #596673;
}

.table-wrap {
  overflow: auto;
  border: 1px solid #dce3ed;
  border-radius: 8px;
  background: #fff;
}

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

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid #e6ebf1;
  text-align: left;
  white-space: nowrap;
}

th {
  color: #596673;
  font-size: 13px;
  font-weight: 700;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  background: #edf1f5;
  color: #596673;
  font-size: 13px;
}

.status.online {
  background: #e8f7ee;
  color: #137a3d;
}

.chart {
  display: flex;
  align-items: end;
  gap: 8px;
  height: 220px;
  padding: 16px;
  border: 1px solid #dce3ed;
  border-radius: 8px;
  background: #fff;
}

.bar {
  display: grid;
  align-items: end;
  justify-items: center;
  gap: 8px;
  min-width: 24px;
  height: 100%;
}

.bar span {
  display: block;
  width: 100%;
  border-radius: 6px 6px 2px 2px;
  background: #0a66c2;
}

.bar small {
  color: #596673;
  font-size: 11px;
  writing-mode: vertical-rl;
}

.graph-page {
  overflow: hidden;
  min-height: 100vh;
  background: #071017;
  color: #f6fbff;
}

.graph-shell {
  position: relative;
  overflow: hidden;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

#graphCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
}

.graph-panel {
  position: fixed;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(8, 14, 19, 0.72);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.26);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.graph-panel-left {
  top: 24px;
  left: 24px;
  display: grid;
  gap: 18px;
  width: min(340px, calc(100vw - 48px));
  padding: 20px;
}

.graph-panel-right {
  right: 24px;
  bottom: 24px;
  display: grid;
  gap: 16px;
  width: min(360px, calc(100vw - 48px));
  padding: 20px;
}

.graph-kicker {
  margin: 0 0 6px;
  color: #8fe8ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.graph-panel h1,
.graph-panel h2 {
  margin: 0;
  color: #fff;
}

.graph-panel h1 {
  font-size: 32px;
  line-height: 1.1;
}

.graph-panel h2 {
  font-size: 24px;
}

.graph-rule {
  margin: 10px 0 0;
  color: rgba(232, 244, 255, 0.72);
  line-height: 1.5;
}

.operator-list {
  display: grid;
  gap: 10px;
  max-height: min(68vh, 650px);
  overflow: auto;
  padding-right: 4px;
}

.operator-card {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  text-align: left;
}

.operator-card.active {
  border-color: rgba(49, 214, 162, 0.62);
  background: linear-gradient(135deg, rgba(49, 214, 162, 0.22), rgba(142, 167, 255, 0.14));
}

.operator-card span {
  font-weight: 800;
}

.operator-card small {
  color: rgba(232, 244, 255, 0.66);
  line-height: 1.35;
}

.state-card {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.07);
}

.state-card span,
.trace-box span {
  color: rgba(232, 244, 255, 0.62);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.state-card strong {
  color: #31d6a2;
  font: 800 28px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.state-card small {
  color: rgba(232, 244, 255, 0.72);
}

.apply-button {
  width: 100%;
  padding: 13px 16px;
  background: linear-gradient(135deg, #31d6a2, #8ea7ff);
  color: #061018;
  font-weight: 900;
}

.trace-box {
  display: grid;
  gap: 10px;
}

.trace-box ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: rgba(232, 244, 255, 0.76);
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 820px) {
  .graph-panel-left,
  .graph-panel-right {
    left: 14px;
    right: 14px;
    width: auto;
    padding: 14px;
  }

  .graph-panel-left {
    top: 14px;
  }

  .graph-panel-right {
    bottom: 14px;
  }

  .operator-list {
    grid-template-columns: 1fr;
  }

  .graph-panel h1 {
    font-size: 24px;
  }
}
