* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  backdrop-filter: blur(10px);
  z-index: 10;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  letter-spacing: 0.08em;
}

.brand-axm {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}

.brand-name {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 0.55rem 1rem;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease;
}

.ghost:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.04);
}

.view {
  flex: 1;
  padding: 2.5rem 2rem 4rem;
  animation: fadeRise 420ms ease;
}

@keyframes fadeRise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero {
  max-width: 1100px;
  margin: 0 auto 2.5rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 700;
  line-height: 0.95;
}

.hero p {
  margin: 1rem 0 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.5;
}

.roster {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.bot-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.25rem;
  align-items: center;
  padding: 1.35rem 0.25rem;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 200ms ease, padding-left 200ms ease;
}

.bot-row:hover {
  background: rgba(255, 255, 255, 0.03);
  padding-left: 0.55rem;
}

.bot-row .title {
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.bot-row .summary {
  grid-column: 2 / 3;
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 0.2rem;
}

.bot-row .meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.chip {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0.35rem 0.55rem;
  white-space: nowrap;
}

.services-pick {
  grid-template-columns: minmax(240px, 340px) 1fr;
}

.service-list h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.pick-hint {
  margin: 0 0 1.25rem;
}

.service-row .svc-num {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.events-panel .terminal-body,
.events-body {
  font-family: "Manrope", "Space Grotesk", system-ui, sans-serif;
  font-size: 0.98rem;
  line-height: 1.55;
  letter-spacing: 0.01em;
  /* keep text inside rounded panels */
  padding: 1rem 1.15rem 1.25rem;
}

.log-line.human {
  padding: 0.45rem 0;
  border-bottom: 1px solid transparent;
  /* contrast vs page --fg: always use terminal tokens via themes.css */
  color: inherit;
}

.log-line.human.example {
  opacity: 0.65;
  font-style: italic;
}

.log-line.human .lvl {
  display: none;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.2);
}

.dot.online {
  background: var(--online);
  animation: pulse 2.2s ease infinite;
}

.dot.degraded {
  background: var(--degraded);
  animation: pulse 2.2s ease infinite;
}

.dot.offline {
  background: var(--offline);
}

.dot.idle {
  background: #6e7f9a;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.45);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(61, 220, 132, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(61, 220, 132, 0);
  }
}

.detail {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 2rem;
  min-height: calc(100vh - 8rem);
}

.detail-side {
  animation: fadeRise 420ms ease;
}

.back {
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-side h1 {
  margin: 1rem 0 0.4rem;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: 0.06em;
}

.detail-side .username {
  color: var(--muted);
  margin: 0 0 1rem;
}

.detail-side .summary {
  line-height: 1.55;
  margin: 0 0 1.25rem;
}

.detail-side ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  line-height: 1.6;
}

.detail-side .actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--fg);
  background: var(--fg);
  color: var(--bg);
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: transform 160ms ease, opacity 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.secondary {
  background: transparent;
  color: var(--fg);
}

.terminal {
  border: 1px solid var(--line);
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeRise 520ms ease;
  border-radius: 12px;
}

.terminal-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 12px 12px 0 0;
}

.terminal-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  text-transform: none;
  letter-spacing: 0;
}

.terminal-bar select,
.terminal-bar input[type="search"] {
  background: var(--bg-elev);
  color: var(--fg);
  border: 1px solid var(--line);
  padding: 0.35rem 0.5rem;
  font-family: var(--sans);
}

.terminal-bar input[type="search"] {
  min-width: 9rem;
}

.terminal-controls .chk {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.ghost-sm {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.ghost-sm:hover {
  border-color: rgba(255, 255, 255, 0.35);
}

.terminal-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 1rem 1.15rem 1.25rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.45;
  color: inherit;
  border-radius: 0 0 12px 12px;
}

.log-line {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 0.25rem;
  opacity: 0;
  animation: lineIn 220ms ease forwards;
}

.log-line .lvl {
  display: inline-block;
  min-width: 4.5rem;
  color: var(--muted);
}

.log-line.ERROR .lvl,
.log-line.CRITICAL .lvl,
.log-line.FATAL .lvl {
  color: var(--offline);
}

.log-line.WARNING .lvl {
  color: var(--degraded);
}


@keyframes lineIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.auth {
  width: min(420px, 100%);
  text-align: left;
}

.auth-axm {
  margin: 0;
  letter-spacing: 0.2em;
  color: var(--muted);
  font-size: 0.8rem;
}

.auth-title {
  margin: 0.35rem 0 0.5rem;
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  letter-spacing: 0.16em;
}

.auth-sub {
  margin: 0 0 1.75rem;
  color: var(--muted);
}

.auth form {
  display: grid;
  gap: 1rem;
}

.auth label {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth input[type="text"],
.auth input[type="password"] {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
  padding: 0.7rem 0;
  outline: none;
}

.auth input:focus {
  border-bottom-color: var(--fg);
}

.remember {
  display: flex !important;
  align-items: center;
  gap: 0.55rem;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 0.95rem !important;
  color: var(--muted);
}

.auth button[type="submit"] {
  margin-top: 0.5rem;
  border: 0;
  padding: 0.9rem 1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.error {
  color: var(--offline);
  margin: 0;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

@media (max-width: 860px) {
  .top,
  .view {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }

  .detail {
    grid-template-columns: 1fr;
  }

  .bot-row {
    grid-template-columns: auto 1fr;
  }

  .bot-row .summary {
    grid-column: 1 / -1;
  }
}
