:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #1d4ed8;
  --accent-text: #ffffff;
  --error: #b91c1c;
  --success: #15803d;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --surface: #1e293b;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --border: #334155;
    --accent: #3b82f6;
    --accent-text: #0f172a;
    --error: #fca5a5;
    --success: #86efac;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
}

.screen {
  min-height: 100vh;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

#gate {
  justify-content: center;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

h1 {
  font-size: 1.25rem;
  margin: 0 0 4px;
}

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 12px;
}

input[type="text"],
input[type="password"],
input[type="url"],
input:not([type]) {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 12px;
  font-size: 1rem;
}

button {
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-text);
  margin-top: 16px;
}

button:disabled { opacity: 0.6; }

.link-btn {
  background: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 4px;
  margin: 0;
  text-decoration: underline;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  margin-top: 4px;
  cursor: pointer;
}

.dropzone.dragover {
  border-color: var(--accent);
  color: var(--text);
}

#file-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

#file-list li {
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.error { color: var(--error); font-size: 0.9rem; }
.success { color: var(--success); font-size: 0.9rem; }

.result {
  margin-top: 20px;
  padding: 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.result a { color: var(--accent); }
