:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-alt: #0b1120;
  --border: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-hover: #0284c7;
  --ok: #22c55e;
  --warn: #f59e0b;
}

* {
  box-sizing: border-box;
}

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

a {
  color: var(--accent);
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--panel-alt);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.badge-protocol {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.4);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

h1 {
  margin: 0.35rem 0 0.25rem;
  font-size: 1.6rem;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.header-meta {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: right;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.panel-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-header h2 {
  margin: 0;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.filters label {
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

input, select, textarea {
  background: var(--panel-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.9rem;
}

.nodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.node-card {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
}

.node-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--muted);
}

.status-pill {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.72rem;
}

.status-active {
  background: rgba(34, 197, 94, 0.15);
  color: var(--ok);
}

.status-pending_notebook {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warn);
}

.node-title {
  margin: 0.25rem 0;
  font-size: 1.05rem;
}

.node-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-primary, .btn-secondary {
  cursor: pointer;
  border-radius: 0.375rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid transparent;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: var(--accent);
  color: #082f49;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.disclaimer-box {
  background: var(--panel-alt);
  border-left: 4px solid var(--accent);
  border-radius: 0.375rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
}

.disclaimer-box h3 {
  margin-top: 0;
  font-size: 0.95rem;
}

.disclaimer-pre {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
  max-height: 210px;
  overflow-y: auto;
}

.submission-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-row label {
  font-size: 0.85rem;
  font-weight: 500;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.receipt-box {
  margin-top: 1rem;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  padding: 0.85rem;
  font-size: 0.85rem;
  white-space: pre-wrap;
}

.hidden {
  display: none;
}

.dev-drawer summary {
  cursor: pointer;
  font-weight: 600;
}
