#app, [data-xftp-app] {
  font-family: system-ui, -apple-system, sans-serif;
  color: #333;
  width: 100%;
  max-width: 480px;
  padding: 16px;
  box-sizing: border-box;
  --xftp-ring-fg: #3b82f6;
}

:is(#app, [data-xftp-app]) .card {
  background: #fff;
  border-radius: 12px;
  padding: 32px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
  text-align: center;
}

:is(#app, [data-xftp-app]) h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 24px;
}

:is(#app, [data-xftp-app]) .stage { margin-top: 16px; }

/* Drop zone */
:is(#app, [data-xftp-app]) .drop-zone {
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 32px 16px;
  transition: border-color .15s, background .15s;
}
:is(#app, [data-xftp-app]) .drop-zone.drag-over {
  border-color: #3b82f6;
  background: #eff6ff;
}

/* Buttons */
:is(#app, [data-xftp-app]) .btn {
  display: inline-block;
  padding: 10px 24px;
  border: none;
  border-radius: 6px;
  background: #3b82f6;
  color: #fff;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
:is(#app, [data-xftp-app]) .btn:hover { background: #2563eb; }
:is(#app, [data-xftp-app]) .btn-secondary { background: #6b7280; }
:is(#app, [data-xftp-app]) .btn-secondary:hover { background: #4b5563; }

/* Hints */
:is(#app, [data-xftp-app]) .hint { color: #999; font-size: .85rem; margin-top: 8px; }
:is(#app, [data-xftp-app]) .expiry { margin-top: 12px; }

/* Progress */
:is(#app, [data-xftp-app]) .progress-ring { display: block; margin: 0 auto 12px; }
:is(#app, [data-xftp-app]) #upload-status,
:is(#app, [data-xftp-app]) #dl-status { font-size: .9rem; color: #666; margin-bottom: 12px; }

/* Share link row */
:is(#app, [data-xftp-app]) .link-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
:is(#app, [data-xftp-app]) .link-row input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: .85rem;
  background: #f9fafb;
}

/* Upload link */
:is(#app, [data-xftp-app]) .upload-link {
  margin-top: 12px;
  color: #3b82f6;
  font-size: .9rem;
  text-decoration: none;
  cursor: pointer;
}
:is(#app, [data-xftp-app]) .upload-link:not([hidden]) {
  display: inline-block;
}
:is(#app, [data-xftp-app]) .upload-link:hover { text-decoration: underline; }

/* Messages */
:is(#app, [data-xftp-app]) .success { color: #16a34a; font-weight: 600; }
:is(#app, [data-xftp-app]) .error { color: #dc2626; font-weight: 500; margin-bottom: 12px; }

/* Security note */
:is(#app, [data-xftp-app]) .security-note {
  margin-top: 20px;
  padding: 12px;
  background: #f0fdf4;
  border-radius: 6px;
  font-size: .8rem;
  color: #555;
  text-align: left;
}
:is(#app, [data-xftp-app]) .security-note p + p { margin-top: 6px; }
:is(#app, [data-xftp-app]) .security-note a { color: #3b82f6; text-decoration: none; }
:is(#app, [data-xftp-app]) .security-note a:hover { text-decoration: underline; }

/* ── Dark mode ─────────────────────────────────── */
.dark :is(#app, [data-xftp-app]) {
  color: #e5e7eb;
  --xftp-ring-bg: #374151;
  --xftp-ring-fg: #60a5fa;
  --xftp-ring-text: #e5e7eb;
  --xftp-ring-done: #4ade80;
}
.dark :is(#app, [data-xftp-app]) .card {
  background: #1f2937;
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.dark :is(#app, [data-xftp-app]) .drop-zone { border-color: #4b5563; }
.dark :is(#app, [data-xftp-app]) .drop-zone.drag-over {
  border-color: #60a5fa;
  background: rgba(59,130,246,.15);
}
.dark :is(#app, [data-xftp-app]) .btn-secondary { background: #4b5563; }
.dark :is(#app, [data-xftp-app]) .btn-secondary:hover { background: #374151; }
.dark :is(#app, [data-xftp-app]) .hint { color: #9ca3af; }
.dark :is(#app, [data-xftp-app]) #upload-status,
.dark :is(#app, [data-xftp-app]) #dl-status { color: #9ca3af; }
.dark :is(#app, [data-xftp-app]) .link-row input {
  background: #374151;
  border-color: #4b5563;
  color: #e5e7eb;
}
.dark :is(#app, [data-xftp-app]) .success { color: #4ade80; }
.dark :is(#app, [data-xftp-app]) .error { color: #f87171; }
.dark :is(#app, [data-xftp-app]) .security-note {
  background: rgba(34,197,94,.1);
  color: #d1d5db;
}
.dark :is(#app, [data-xftp-app]) .upload-link { color: #60a5fa; }
.dark :is(#app, [data-xftp-app]) .security-note a { color: #60a5fa; }
