:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #152033;
  --muted: #667085;
  --line: #dde4ef;
  --accent: #1663ff;
  --accent-dark: #0d47c7;
  --success: #13a467;
  --warning: #f59e0b;
  --danger: #e5484d;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  --radius: 22px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: radial-gradient(circle at top left, #eaf1ff, transparent 34%), var(--bg);
  color: var(--text);
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 44px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: stretch;
  background: linear-gradient(135deg, #ffffff, #eef4ff);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 30px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  letter-spacing: -0.06em;
  line-height: 0.95;
}

.subtitle {
  max-width: 700px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.status-card {
  min-width: 270px;
  display: flex;
  gap: 12px;
  align-items: center;
  align-self: center;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
}

.status-card strong, .status-card span { display: block; }
.status-card strong { font-size: 15px; }

.status-card span:last-child {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #9aa4b2;
  box-shadow: 0 0 0 6px rgba(154, 164, 178, 0.14);
}

.status-dot.connecting {
  background: var(--warning);
  box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.15);
}

.status-dot.connected {
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(19, 164, 103, 0.15);
}

.status-dot.error {
  background: var(--danger);
  box-shadow: 0 0 0 6px rgba(229, 72, 77, 0.15);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.panel.full { grid-column: 1 / -1; }

.panel-header { margin-bottom: 18px; }
.panel-header h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.panel-header p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.field span {
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 13px;
  color: var(--text);
  background: #fbfdff;
  outline: none;
}

textarea { resize: vertical; }

input:focus, select:focus, textarea:focus {
  border-color: rgba(22, 99, 255, 0.65);
  box-shadow: 0 0 0 4px rgba(22, 99, 255, 0.1);
}

.checkbox-line {
  display: flex;
  gap: 10px;
  align-items: center;
  color: #344054;
  font-weight: 700;
  font-size: 14px;
}

.checkbox-line input { width: auto; }

.notice {
  margin-top: 16px;
  background: #f7faff;
  border: 1px dashed #b8c9ff;
  border-radius: 16px;
  padding: 12px;
  color: #42526d;
  font-size: 13px;
  line-height: 1.45;
}

.primary-btn, .ghost-btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 800;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.primary-btn {
  width: 100%;
  background: var(--accent);
  color: white;
  box-shadow: 0 10px 22px rgba(22, 99, 255, 0.22);
}

.primary-btn:hover:not(:disabled) {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.ghost-btn {
  background: #eef4ff;
  color: var(--accent);
}

.pin-box {
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  text-align: center;
  background: #fbfdff;
}

.pin-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pin-box strong {
  display: block;
  margin: 8px 0 13px;
  font-size: 32px;
  letter-spacing: 0.12em;
}

.mini-log {
  min-height: 96px;
  max-height: 190px;
  overflow: auto;
  background: #0f172a;
  color: #d9e4ff;
  border-radius: 16px;
  padding: 13px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.share-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.share-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: #fbfdff;
}

.file-drop {
  display: grid;
  place-items: center;
  min-height: 162px;
  border: 1px dashed #a7b7d8;
  border-radius: 18px;
  background: #ffffff;
  text-align: center;
  cursor: pointer;
  padding: 18px;
  margin-bottom: 12px;
}

.file-drop input { display: none; }

.file-drop span {
  font-weight: 900;
  color: var(--accent);
}

.file-drop small {
  display: block;
  max-width: 100%;
  margin-top: 8px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

progress {
  width: 100%;
  height: 12px;
  margin-top: 12px;
  accent-color: var(--success);
}

.received-area { margin-top: 22px; }
.received-area h3 { margin: 0 0 12px; }

.received-list {
  display: grid;
  gap: 12px;
}

.received-item {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 16px;
  padding: 14px;
  overflow-wrap: anywhere;
}

.received-item strong {
  display: block;
  margin-bottom: 7px;
}

.received-item a {
  color: var(--accent);
  font-weight: 800;
}

.empty {
  color: var(--muted);
  margin: 0;
}

@media (max-width: 950px) {
  .hero, .share-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
  .grid { grid-template-columns: 1fr; }
  .status-card { width: 100%; }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    margin-top: 10px;
  }
  .hero, .panel { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
}
