* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: #f3f3f3;
  display: flex;
  justify-content: center;
  padding: 40px 16px;
  min-height: 100dvh;
  align-items: center;
}

.container {
  max-width: 480px;
  width: 100%;
  background: #fff;
  border-radius: 10px;
  padding: 2em;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

h1 {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: #222;
  margin-bottom: 4px;
}

.subtitle {
  text-align: center;
  font-size: 13px;
  color: #888;
  margin-bottom: 1.2em;
}

.meta {
  text-align: center;
  font-size: 13px;
  color: #888;
  margin-bottom: 1em;
}

.meta .value {
  font-weight: 600;
  color: #555;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.meta .badge-peer {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: #e8f5e9;
  color: #2e7d32;
}

textarea {
  width: 100%;
  height: 200px;
  padding: 0.6em;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color .2s;
  -webkit-appearance: none;
  background: #fff;
  color: #333;
}

textarea:focus {
  border-color: #007bff;
}

textarea::placeholder {
  color: #bbb;
}

.buttons {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-paste {
  background: #fff;
  color: #007bff;
  padding: 0.7em 1.5em;
  border-radius: 5px;
  border: 1.5px solid #007bff;
}

.btn-paste:hover {
  background: #f0f7ff;
}

.btn-paste:active {
  background: #e0efff;
}

.btn-copy {
  background: #007bff;
  color: #fff;
  padding: 0.7em 1.5em;
  border-radius: 5px;
}

.btn-copy:hover {
  background: #0069d9;
}

.btn-copy:active {
  background: #0056b3;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 14px 0;
  font-size: 13px;
  color: #888;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ddd;
  transition: background .3s;
}

.status-dot.connected {
  background: #28a745;
}

.qr-section {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.qr-section p {
  font-size: 13px;
  color: #888;
  margin-bottom: 12px;
}

.qr-wrapper {
  display: inline-block;
  background: #fff;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #eee;
}

#qrImage {
  display: block;
  max-width: 180px;
  height: auto;
}

.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #333;
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 13px;
  opacity: 0;
  transition: all .3s ease;
  pointer-events: none;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 480px) {
  body {
    padding: 0;
    align-items: stretch;
  }

  .container {
    max-width: 100%;
    border-radius: 0;
    padding: 24px 20px;
    border: none;
    box-shadow: none;
    min-height: 100dvh;
  }

  textarea {
    height: calc(100dvh - 380px);
    min-height: 120px;
    font-size: 16px;
  }

  button {
    padding: 14px;
    font-size: 15px;
  }
}


