:root {
  color-scheme: dark;
  --page: #17181d;
  --page-edge: #101116;
  --terminal: #090a0d;
  --terminal-edge: #202127;
  --titlebar: #303139;
  --titlebar-edge: #27282e;
  --text: #d2d1d7;
  --muted: #62636c;
  --green: #51f29b;
  --green-dim: #3fbd7d;
  --pink: #ff6e8d;
  --yellow: #efbd55;
  --missing: #22242a;
  --tooltip: #050608;
  --grid-gap: 2px;
  font-family: "Cascadia Mono", "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 15px;
  font-synthesis: none;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 280px;
  min-height: 100%;
  background: var(--page);
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 48px 20px;
  color: var(--text);
  background:
    radial-gradient(ellipse at center, #1c1d22 0%, var(--page) 63%, var(--page-edge) 100%);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
}

.terminal {
  width: min(1060px, 100%);
  min-height: 828px;
  overflow: hidden;
  border: 1px solid var(--terminal-edge);
  border-radius: 8px;
  background: var(--terminal);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.36);
}

.titlebar {
  position: relative;
  height: 37px;
  border-bottom: 1px solid var(--titlebar-edge);
  background: linear-gradient(#34353d, #2b2c33);
  display: flex;
  align-items: center;
  justify-content: center;
}

.window-controls {
  position: absolute;
  left: 15px;
  display: flex;
  gap: 10px;
}

.control {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.16);
}

.close { background: #ff5f57; }
.minimize { background: #febc2e; }
.maximize { background: #28c840; }

.window-title {
  color: #777881;
  font-size: 13px;
  font-weight: 700;
}

.screen {
  position: relative;
  min-height: 739px;
  padding: 24px 22px 28px;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.012) 0,
    rgba(255, 255, 255, 0.012) 1px,
    transparent 1px,
    transparent 3px
  );
}

.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 80, 80, 0.012), transparent 35%, rgba(80, 170, 255, 0.009));
}

.intro {
  line-height: 1.55;
  margin-bottom: 24px;
}

.muted { color: var(--muted); }
.italic { font-style: italic; }
.green, .prompt { color: var(--green); }
.pink, .model-list { color: #ef8097; }
.flag { color: var(--yellow); }

.command {
  line-height: 1.5;
  margin: 0 0 8px;
  font-weight: 600;
}

.prompt {
  margin-right: 8px;
  font-weight: 800;
}

.output-line {
  margin-bottom: 8px;
  color: #aaaab2;
}

.overall {
  margin-bottom: 26px;
  font-weight: 700;
}

.overall.degraded,
.offline,
.uptime-bad {
  color: var(--pink);
}

.overall.checking,
.checking {
  color: var(--yellow);
}

.monitor-command {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  margin-bottom: 12px;
}

.monitor-command .prompt {
  margin-right: 0;
}

.model-list {
  overflow-wrap: anywhere;
}

.model {
  margin-bottom: 17px;
}

.model-heading {
  display: flex;
  align-items: baseline;
  min-width: 0;
  margin-bottom: 5px;
  font-weight: 700;
}

.arrow {
  flex: none;
  width: 20px;
  color: #4f5057;
}

.model-name {
  overflow-wrap: anywhere;
}

.model-state {
  margin-left: 10px;
  white-space: nowrap;
}

.model-state.online { color: var(--green); }
.model-state.offline { color: var(--pink); }
.model-state.checking { color: var(--yellow); }

.model-meta {
  margin: 0 0 8px 20px;
  color: #73747d;
  font-size: 13px;
}

.model-meta strong {
  color: var(--green);
}

.model-meta strong.uptime-bad {
  color: var(--pink);
}

.history-wrap {
  margin-left: 20px;
}

.history {
  display: grid;
  grid-template-columns: repeat(60, minmax(1px, 1fr));
  gap: var(--grid-gap);
  width: 100%;
  height: 28px;
}

.sample {
  min-width: 1px;
  height: 28px;
  background: var(--missing);
  border: 0;
}

.sample.ok {
  background: var(--green);
  box-shadow: 0 0 7px rgba(81, 242, 155, 0.08);
}

.sample.fail {
  background: #ff5b7d;
  box-shadow: 0 0 7px rgba(255, 91, 125, 0.08);
}

.sample.has-data:hover {
  outline: 1px solid rgba(255, 255, 255, 0.7);
  outline-offset: 1px;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-top: 6px;
  color: #4f5058;
  font-size: 12px;
}

.timeline span:nth-child(2),
.timeline span:nth-child(3),
.timeline span:nth-child(4) { text-align: center; }
.timeline span:last-child { text-align: right; }

.final-prompt {
  display: flex;
  align-items: center;
  margin: 4px 0 0;
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 17px;
  margin-left: -4px;
  background: #85868e;
  animation: blink 1.08s steps(1, end) infinite;
}

@keyframes blink {
  0%, 46% { opacity: 0.85; }
  47%, 100% { opacity: 0.16; }
}

.footer {
  height: 51px;
  padding: 0 22px;
  border-top: 1px dashed #1c1d22;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.tooltip {
  position: fixed;
  z-index: 20;
  display: none;
  max-width: min(620px, calc(100vw - 20px));
  padding: 12px 14px;
  border: 1px solid #272830;
  border-radius: 3px;
  color: #b7b7bf;
  background: var(--tooltip);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  font-size: 13px;
  line-height: 1.5;
  pointer-events: none;
  white-space: normal;
  overflow-wrap: anywhere;
}

.tooltip.visible { display: block; }
.tooltip-title { display: block; font-weight: 800; }
.tooltip-title.ok { color: var(--green); }
.tooltip-title.fail { color: var(--pink); }
.tooltip-detail { display: block; }

@media (max-width: 700px) {
  :root {
    --grid-gap: 1px;
    font-size: 13px;
  }

  body {
    padding: 12px 8px;
  }

  .terminal {
    min-height: calc(100vh - 24px);
  }

  .titlebar { height: 34px; }
  .window-controls { left: 11px; gap: 7px; }
  .control { width: 11px; height: 11px; }
  .window-title { font-size: 11px; }

  .screen {
    min-height: calc(100vh - 102px);
    padding: 17px 12px 22px;
  }

  .intro { margin-bottom: 18px; }
  .overall { margin-bottom: 21px; }
  .model { margin-bottom: 15px; }
  .model-meta, .history-wrap { margin-left: 0; }
  .history, .sample { height: 22px; }
  .model-state { margin-left: 7px; }
  .timeline { font-size: 10px; }
  .footer { height: 43px; padding: 0 12px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
}
