/* Layout */
.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 22px 32px;
}

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.logo {
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.6px;
  color: var(--text);
}

.logo strong {
  color: var(--accent);
  font-weight: 800;
}

.tag {
  color: var(--muted);
  font-size: 12px;
  opacity: 0.9;
}

/* Panels */
.panel {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: var(--space-lg);
}

/* Controls */
.controls {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
}

.controls label {
  font-size: 0.875rem;
  color: var(--muted);
}

.controls input[type="text"],
.controls input[type="search"] {
  background: #0b1219;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: var(--font-mono);
}

.controls input::placeholder {
  color: #5d7184;
}

.controls input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 242, 166, 0.15);
}

.controls input[readonly] {
  background: #070a0d;
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.7;
}

.controls input[readonly]:focus {
  border-color: var(--border);
  box-shadow: none;
}

/* Buttons */
.btn {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  user-select: none;
  background: linear-gradient(180deg, #12211b, #0e1b16);
  border: 1px solid #174c3b;
  color: var(--accent);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  font-family: var(--font-mono);
  font-size: 14px;
  transition: transform 0.05s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: inset 0 0 0 1px rgba(29, 242, 166, 0.15), 0 2px 0 0 #0a0f0d;
}

.btn:hover:not(:disabled) {
  border-color: #1df2a6;
  box-shadow: inset 0 0 0 1px rgba(29, 242, 166, 0.3), 0 2px 0 0 #0a0f0d, var(--glow);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: #0f141a;
  color: var(--muted);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn-secondary:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(29, 242, 166, 0.15);
}

.btn-primary {
  background: linear-gradient(180deg, #1a3d33, #143028);
  border: 1px solid #1df2a6;
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(29, 242, 166, 0.25), 0 2px 0 0 #0a0f0d;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #1e4a3c, #16382f);
  box-shadow: inset 0 0 0 1px rgba(29, 242, 166, 0.4), 0 2px 0 0 #0a0f0d, var(--glow);
}

.btn.small {
  padding: 6px 10px;
  font-size: 12px;
}

/* Status indicators */
.stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--muted);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #59697a;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.02) inset, 0 0 12px transparent;
  transition: all 0.3s ease;
}

.dot.good {
  background: var(--good);
  box-shadow: 0 0 0 2px rgba(46, 229, 123, 0.15) inset, 0 0 10px rgba(46, 229, 123, 0.35);
}

.dot.warn {
  background: var(--warn);
  box-shadow: 0 0 0 2px rgba(255, 184, 107, 0.15) inset, 0 0 10px rgba(255, 184, 107, 0.35);
}

.dot.bad {
  background: var(--danger);
  box-shadow: 0 0 0 2px rgba(255, 83, 112, 0.15) inset, 0 0 10px rgba(255, 83, 112, 0.35);
}

/* Utility classes */
.muted {
  color: var(--muted);
}

.small {
  font-size: 0.875rem;
}

.mono {
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
}

.row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.spacer {
  flex: 1;
}

.hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted-2);
}

.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Message cards */
.msg {
  background: linear-gradient(180deg, #0b1016, #0a0f15);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease;
}

.msg:hover {
  border-color: #243649;
}

.meta {
  color: var(--muted);
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}

.meta .badge {
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid #1a2a38;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(29, 242, 166, 0.06);
}

.meta .k {
  color: #7fa1b7;
}

.payload {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
}

/* Code blocks */
code {
  background: rgba(29, 242, 166, 0.06);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--accent);
}

pre {
  margin: 0;
  white-space: pre;
  font-family: var(--font-mono);
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
  letter-spacing: 0;
  tab-size: 4;
}

/* Empty state */
.empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

/* Responsive */
@media (max-width: 820px) {
  .wrap {
    padding: 20px 16px;
  }

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

  .controls label {
    margin-top: 8px;
  }

  .controls label:first-child {
    margin-top: 0;
  }
}
