:root {
  --bg: #0b0b0f;
  --surface: #121218;
  --surface-2: #1e1e24;
  --surface-3: #2a2a33;
  --on-surface: #ececee;
  --muted: #8a8a93;
  --accent: #1db954;
  --accent-ink: #0b0b0f;
  --danger: #e74c3c;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--on-surface);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

.topbar {
  padding: 22px 28px;
  border-bottom: 1px solid var(--surface-2);
}

.brand {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.shell {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  background: var(--surface);
  border-radius: 100px;
  margin-bottom: 28px;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 22px;
  border-radius: 100px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}

.tab:hover { color: var(--on-surface); }

.tab.active {
  background: var(--accent);
  color: var(--accent-ink);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

h2 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
}

.hint {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 15px;
}

.form-card {
  background: var(--surface);
  border-radius: 18px;
  padding: 22px;
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
}

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

input[type="text"], input[type="url"], input[type="password"], textarea {
  background: var(--surface-2);
  border: 1px solid var(--surface-3);
  border-radius: 10px;
  color: var(--on-surface);
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

input:focus, textarea:focus {
  border-color: var(--accent);
}

textarea {
  min-height: 200px;
  resize: vertical;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 13px;
}

.row {
  display: flex;
  gap: 10px;
  margin: 14px 0;
}

.row input { flex: 1; }

.hint-inline {
  color: var(--muted);
  font-size: 14px;
  align-self: center;
}

button {
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 12px 20px;
  border-radius: 100px;
  border: 0;
  transition: transform 0.08s, background 0.15s;
}

button:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover { background: #20d25f; }

.btn-secondary {
  background: var(--surface-2);
  color: var(--on-surface);
}

.btn-secondary:hover { background: var(--surface-3); }

.channel-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.channel-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border-radius: 14px;
  padding: 12px 16px;
}

.channel-row img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--surface-2);
  object-fit: cover;
}

.channel-row .meta {
  flex: 1;
  min-width: 0;
}

.channel-row .name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-row .url {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-row .remove {
  background: transparent;
  color: var(--danger);
  padding: 6px 10px;
  font-weight: 700;
}

.export {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--surface-2);
}

.export-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

@media (max-width: 680px) {
  .export-grid { grid-template-columns: 1fr; }
}

.export-card {
  background: var(--surface);
  border-radius: 18px;
  padding: 20px;
  display: grid;
  gap: 10px;
}

.export-card input { margin-bottom: 6px; }

#pair-code {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 2px;
}

.send-status {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--muted);
  min-height: 1em;
}

.send-status.ok { color: var(--accent); }
.send-status.err { color: var(--danger); }

