:root {
  color-scheme: light dark;
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1b1f24;
  --muted: #5d6673;
  --border: #d9dee5;
  --accent: #2457d6;
  --accent-text: #ffffff;
  --danger: #c62828;
  --warn-bg: #fff6e0;
  --warn-text: #6b4b00;
  --ok: #1b7a3a;
  --input: #ffffff;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --card: #171b21;
    --text: #e6e9ee;
    --muted: #98a2b0;
    --border: #2b323c;
    --accent: #5b8cff;
    --accent-text: #0b1020;
    --danger: #ff6b6b;
    --warn-bg: #2d2513;
    --warn-text: #f3d48a;
    --ok: #5fd38a;
    --input: #0f1216;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}

.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }

.badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}

main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px 32px; }

footer { text-align: center; padding: 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

h1 { font-size: 1.35rem; margin: 0 0 12px; }

.filename { overflow-wrap: anywhere; }

label { display: block; font-weight: 600; margin: 14px 0 6px; }

label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 10px 0; }

input[type="text"], input[type="password"], input:not([type]), select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input);
  color: var(--text);
  font: inherit;
}

select { font-weight: 400; margin-top: 6px; }

textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9rem; resize: vertical; }

input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, .drop:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button {
  font: inherit;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}

button:disabled { opacity: 0.55; cursor: not-allowed; }

button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }

button.danger { color: var(--danger); border-color: var(--danger); }

button.link { background: none; border: none; padding: 0; color: var(--accent); text-decoration: underline; }

button.wide { width: 100%; margin-top: 16px; padding: 12px; }

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

.row.between { justify-content: space-between; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }

.tabs button { border: none; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 8px 14px; color: var(--muted); }

.tabs button[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--text); font-weight: 600; }

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 140px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  font-weight: 500;
  text-align: center;
  padding: 16px;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.drop.over { border-color: var(--accent); }

.options { border: none; padding: 0; margin: 8px 0 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.copyrow { display: flex; gap: 8px; }

.copyrow input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; }

.progress { margin-top: 14px; }

progress { width: 100%; height: 10px; accent-color: var(--accent); }

.facts { list-style: none; padding: 0; margin: 8px 0 12px; color: var(--muted); }

.facts li { margin: 2px 0; }

.paste {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  max-height: 70vh;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
}

.muted { color: var(--muted); }

.small { font-size: 0.85rem; }

.error { color: var(--danger); font-weight: 500; }

.ok { color: var(--ok); font-weight: 500; }

.warn { background: var(--warn-bg); color: var(--warn-text); padding: 10px 12px; border-radius: 8px; }

[hidden] { display: none !important; }
