:root {
  color-scheme: light dark;
  --bg: #f5f6f8;
  --fg: #17191d;
  --muted: #5f6670;
  --line: #d8dde3;
  --accent: #1f6feb;
  --accent-fg: #ffffff;
  --ok-bg: #e6f4ea;
  --ok-fg: #0f5132;
  --err-bg: #fde8e8;
  --err-fg: #86181d;
  --code-bg: #0f172a;
  --code-fg: #e2e8f0;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --fg: #e6e8eb;
    --muted: #9aa3af;
    --line: #2a2f37;
    --accent: #58a6ff;
    --ok-bg: #0d2a1a;
    --ok-fg: #7ee2a8;
    --err-bg: #2a0d0d;
    --err-fg: #ff8b8b;
    --code-bg: #1a1f29;
    --code-fg: #e2e8f0;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  min-height: 100vh;
  padding: 32px 16px;
}
main {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
header h1 { margin: 0 0 4px; font-size: 28px; }
.lede { margin: 0; color: var(--muted); }
section {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}
section h2 { margin: 0 0 12px; font-size: 18px; }
form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
label { font-weight: 600; }
input[type="text"] {
  flex: 1 1 200px;
  min-width: 0;
  font: inherit;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  text-transform: uppercase;
}
input[type="text"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.file-pick {
  flex: 1 1 240px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
.file-pick:hover { border-color: var(--accent); color: var(--accent); }
button {
  font: inherit;
  font-weight: 600;
  padding: 10px 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-fg);
  cursor: pointer;
}
button:hover { filter: brightness(1.05); }
button:disabled { opacity: 0.6; cursor: not-allowed; }
.result {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--ok-bg);
  color: var(--ok-fg);
  word-break: break-all;
}
.result.error { background: var(--err-bg); color: var(--err-fg); }
.result p { margin: 0 0 6px; }
.result p:last-child { margin-bottom: 0; }
.result code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 1.1em;
  letter-spacing: 0.1em;
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
}
.result .share-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}
.result .share-row input {
  flex: 1;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
  letter-spacing: 0;
  text-transform: none;
}
.result .download-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 14px;
  background: var(--accent);
  color: var(--accent-fg);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}
.muted { color: var(--muted); font-size: 0.92em; }
footer { text-align: center; color: var(--muted); }
