:root {
  color-scheme: light dark;
  --bg: #f6f7f9;
  --card: #ffffff;
  --border: rgba(15, 23, 42, 0.1);
  --text: #0f172a;
  --muted: #526071;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --ok-bg: rgba(22, 163, 74, 0.1);
  --ok-text: #15803d;
  --err-bg: rgba(220, 38, 38, 0.1);
  --err-text: #b91c1c;
  --surface: #f1f5f9;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f17;
    --card: #121826;
    --border: rgba(248, 250, 252, 0.1);
    --text: #f8fafc;
    --muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --ok-bg: rgba(34, 197, 94, 0.14);
    --ok-text: #4ade80;
    --err-bg: rgba(248, 113, 113, 0.14);
    --err-text: #f87171;
    --surface: #0f172a;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.shell {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.pill {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ok-bg);
  color: var(--ok-text);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

h1 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
}

.subtitle {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

.passphrase-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.passphrase-form label {
  font-size: 13px;
  font-weight: 600;
}

.row {
  display: flex;
  gap: 10px;
}

input[type="password"] {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

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

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

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

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
}

.progress-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.15s ease-out;
}

.progress-label {
  font-size: 12px;
  color: var(--muted);
  min-width: 44px;
  text-align: right;
}

.error-box {
  background: var(--err-bg);
  color: var(--err-text);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
}

.file-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.file-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.file-name {
  font-size: 17px;
  font-weight: 600;
  word-break: break-word;
}

.file-details {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.integrity-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--ok-bg);
  color: var(--ok-text);
  word-break: break-all;
}

.preview-container {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 14px;
  max-height: 520px;
  overflow: auto;
}

.preview-container pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.5;
}

.preview-container img {
  display: block;
  max-width: 100%;
  max-height: 480px;
  margin: 0 auto;
  border-radius: 8px;
}

.preview-container iframe {
  width: 100%;
  height: 480px;
  border: 0;
  border-radius: 8px;
}

.preview-container audio,
.preview-container video {
  width: 100%;
}

.footer {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
