:root {
  color-scheme: dark;
  --bg: #090b0f;
  --panel: #121722;
  --panel-2: #171f2d;
  --text: #f4f7fb;
  --muted: #8d9aad;
  --line: #263246;
  --green: #35e28b;
  --blue: #4aa8ff;
  --amber: #ffbe55;
  --red: #ff6262;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
}

h2 {
  font-size: 1.05rem;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.icon-button:hover,
button:hover {
  border-color: var(--green);
}

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

.text-button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.panel {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

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

.login-panel {
  max-width: 420px;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1119;
  color: var(--text);
}

select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1119;
  color: var(--text);
}

button[type="submit"] {
  min-height: 44px;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: var(--green);
  color: #05100a;
  font-weight: 800;
  cursor: pointer;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card {
  min-height: 132px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

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

.metric-card strong {
  display: block;
  margin: 10px 0 4px;
  font-size: 2.1rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid rgba(53, 226, 139, 0.35);
  border-radius: 999px;
  color: var(--green);
  background: rgba(53, 226, 139, 0.08);
  font-weight: 800;
  white-space: nowrap;
}

.muted {
  color: var(--muted);
}

.status-copy {
  color: var(--muted);
  line-height: 1.55;
}

canvas {
  display: block;
  width: 100%;
  max-height: 300px;
  border-radius: 8px;
  background: #0d1119;
}

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

.activity {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1119;
}

.activity strong {
  display: block;
}

.activity small {
  color: var(--muted);
}

.classification-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(140px, 180px) minmax(100px, 140px) 1fr auto;
  gap: 10px;
  align-items: end;
}

.classification-form button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.error {
  color: var(--red);
}

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

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

  .classification-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

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