:root {
  --bg: #0b1220;
  --bg-soft: #131d33;
  --panel: rgba(12, 19, 34, 0.9);
  --border: rgba(148, 163, 184, 0.18);
  --text: #e5eefc;
  --muted: #95a6c7;
  --accent: #22c55e;
  --accent-2: #38bdf8;
  --warn: #f59e0b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "PingFang SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 30%),
    radial-gradient(circle at bottom right, rgba(34, 197, 94, 0.2), transparent 32%),
    linear-gradient(160deg, #07101d, #0f172a 45%, #09101d);
}

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.topbar,
.grid {
  display: grid;
  gap: 20px;
}

.topbar {
  grid-template-columns: 1fr auto;
  align-items: end;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-2);
}

h1,
h2,
pre,
textarea,
button,
select {
  margin: 0;
}

h1 {
  font-size: clamp(30px, 4vw, 44px);
}

h2 {
  font-size: 18px;
}

.status-group {
  display: flex;
  gap: 12px;
}

.status-card,
.panel {
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(16px);
  border-radius: 20px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
}

.status-card {
  min-width: 124px;
  padding: 14px 16px;
}

.status-card span,
.meta-line,
.ascii-preview span {
  color: var(--muted);
  font-size: 13px;
}

.status-card strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.grid {
  grid-template-columns: 1.2fr 0.8fr;
}

.panel {
  padding: 18px;
}

.panel-head,
.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

#client-select,
textarea,
button,
.mode-btn {
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.95);
  color: var(--text);
  border-radius: 14px;
}

#client-select {
  padding: 10px 12px;
  min-width: 260px;
}

.ghost-btn {
  padding: 10px 14px;
  color: var(--muted);
  background: rgba(9, 14, 28, 0.82);
}

.bytes-box,
textarea,
pre {
  margin-top: 14px;
  width: 100%;
}

.bytes-box,
pre,
textarea {
  font-family: "JetBrains Mono", "SFMono-Regular", monospace;
}

.bytes-box,
pre {
  min-height: 320px;
  max-height: 480px;
  overflow: auto;
  padding: 16px;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.12);
  white-space: pre-wrap;
  word-break: break-word;
}

.ascii-preview {
  margin-top: 16px;
}

textarea {
  min-height: 446px;
  resize: vertical;
  padding: 16px;
  font-size: 14px;
}

.mode-tabs {
  display: flex;
  gap: 8px;
}

.mode-btn,
#send-btn {
  padding: 10px 18px;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.mode-btn.active,
#send-btn {
  background: linear-gradient(135deg, #0891b2, #22c55e);
  border-color: transparent;
  color: #04111d;
  font-weight: 700;
}

.mode-btn:hover,
#send-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
}

@media (max-width: 900px) {
  .topbar,
  .grid {
    grid-template-columns: 1fr;
  }

  .status-group {
    flex-wrap: wrap;
  }

  #client-select {
    min-width: 0;
    width: 100%;
  }

  .head-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-head,
  .action-row {
    flex-direction: column;
    align-items: stretch;
  }
}
