:root {
  --bg: #0f1115;
  --card: #181b22;
  --line: #2a2f3a;
  --fg: #e6e8ee;
  --muted: #98a0b3;
  --accent: #6ea8fe;
  --danger: #f0736a;
  --ok: #57c98a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  padding: 2rem 1rem 4rem;
}
header { max-width: 640px; margin: 0 auto 1.5rem; }
h1 { margin: 0; font-size: 1.6rem; letter-spacing: -0.02em; }
.tag { color: var(--muted); margin: 0.25rem 0 0; }
main { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
}
h2 { margin: 0 0 0.75rem; font-size: 1.05rem; }
.hint { color: var(--muted); font-size: 0.88rem; margin: 0 0 0.75rem; }
label { display: block; margin: 0.6rem 0; font-size: 0.9rem; color: var(--muted); }
input, textarea {
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.55rem 0.7rem;
  background: #0f1218;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--fg);
  font: inherit;
}
textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; }
button {
  appearance: none;
  border: 1px solid var(--line);
  background: #222734;
  color: var(--fg);
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: #0b0e14; border-color: transparent; font-weight: 600; }
button.danger { color: var(--danger); border-color: #4a2a2a; }
button.link { background: none; border: none; color: var(--muted); padding: 0.4rem 0; text-decoration: underline; }
button:disabled { opacity: 0.5; cursor: progress; }
.row { display: flex; gap: 0.6rem; align-items: flex-end; flex-wrap: wrap; margin: 0.6rem 0; }
.row label { flex: 1; margin: 0; min-width: 140px; }
.filebtn { display: inline-block; cursor: pointer; color: var(--accent); font-size: 0.88rem; }
.status { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 1rem; margin: 0 0 1rem; }
.status dt { color: var(--muted); }
.status dd { margin: 0; font-family: ui-monospace, Menlo, monospace; font-size: 0.85rem; word-break: break-all; }
.out {
  background: #0b1f14;
  border: 1px solid #235; border-color: #1e3a2a;
  padding: 0.8rem; border-radius: 8px; white-space: pre-wrap;
  word-break: break-word; color: var(--ok); margin-top: 0.6rem;
}
.archive-list { list-style: none; padding: 0; margin: 0.4rem 0; }
.archive-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.45rem 0; border-bottom: 1px solid var(--line);
}
.archive-list li:last-child { border-bottom: 0; }
.archive-list span { overflow-wrap: anywhere; }
.out h3 { margin: 0.8rem 0 0.25rem; color: var(--fg); font-size: 0.95rem; }
details { margin: 0.8rem 0; }
summary { cursor: pointer; color: var(--muted); }
.hidden { display: none !important; }
.tabs { display: flex; gap: 0.4rem; margin: 0.25rem 0; }
.tabs button { flex: 1; }
.tabs button.active { background: var(--accent); color: #0b0e14; border-color: transparent; font-weight: 600; }
.tab { display: flex; flex-direction: column; gap: 1rem; }
label.mt { margin-top: 1rem; }
code { background: #0f1218; padding: 0.1rem 0.3rem; border-radius: 4px; font-size: 0.85em; }
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%);
  background: #222734; border: 1px solid var(--line); color: var(--fg);
  padding: 0.6rem 1rem; border-radius: 8px; max-width: 90%;
}
.toast.err { border-color: var(--danger); color: var(--danger); }
