:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #1c2128;
  --muted: #5b6570;
  --line: #d8dde3;
  --brand: #1f6feb;
  --brand-ink: #ffffff;
  --brand-dark: #1a5fd0;
  --ok: #1a7f4b;
  --err: #c23934;
  --err-bg: #fdecea;
  --radius: 12px;
  --focus: 0 0 0 3px rgba(31, 111, 235, 0.4);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c; --card: #1d2127; --ink: #e6e9ec; --muted: #9aa4af;
    --line: #333a43; --err-bg: #3a2321;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 780px; margin: 0 auto; padding: 24px 20px 64px; }

header.site { display: flex; align-items: center; gap: 10px; padding: 6px 0 20px; }
header.site a { color: inherit; text-decoration: none; font-weight: 700; letter-spacing: -0.01em; }
header.site .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }

a { color: var(--brand); }
a:focus-visible, button:focus-visible, input:focus-visible, .dropzone:focus-visible {
  outline: none; box-shadow: var(--focus); border-radius: 8px;
}

h1 { font-size: 26px; margin: 4px 0 6px; letter-spacing: -0.02em; }
.lede { color: var(--muted); margin: 0 0 24px; }

/* home cards */
.tools { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .tools { grid-template-columns: 1fr; } }
.tool-card {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; text-decoration: none; color: inherit;
  transition: border-color .15s, transform .15s;
}
.tool-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.tool-card h2 { margin: 0 0 4px; font-size: 18px; }
.tool-card p { margin: 0; color: var(--muted); font-size: 14px; }

/* tool page */
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px;
}
.constraints { font-size: 13px; color: var(--muted); margin: 0 0 14px; }

.dropzone {
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 34px 20px; text-align: center; background: transparent;
  transition: border-color .15s, background .15s; cursor: pointer; display: block;
}
.dropzone.drag { border-color: var(--brand); background: rgba(31, 111, 235, 0.06); }
.dropzone p { margin: 10px 0 0; color: var(--muted); font-size: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; cursor: pointer;
  border-radius: 10px; padding: 11px 20px; border: 1px solid transparent;
}
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary[disabled] { opacity: .55; cursor: not-allowed; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-lg { padding: 13px 26px; font-size: 16px; }
.btn-block { width: 100%; }

.file-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px; margin: 4px 0 16px;
}
.file-row .name { font-weight: 600; word-break: break-all; }
.file-row .size { color: var(--muted); font-size: 13px; margin-left: auto; white-space: nowrap; }
.file-row button { flex: none; }

.status { margin: 16px 0 0; min-height: 24px; font-size: 14px; }
.status .working { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); }
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

.result {
  margin-top: 16px; padding: 16px; border: 1px solid var(--line);
  border-radius: 10px; background: rgba(26, 127, 75, 0.08);
}
.result h3 { margin: 0 0 4px; font-size: 15px; color: var(--ok); }
.result .meta { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.result .row { display: flex; gap: 10px; flex-wrap: wrap; }

.error {
  margin-top: 16px; padding: 14px 16px; border: 1px solid var(--err);
  border-radius: 10px; background: var(--err-bg); color: var(--err); font-size: 14px;
}
.error .row { margin-top: 10px; }

.notice {
  font-size: 13px; color: var(--muted); background: transparent;
  border-left: 3px solid var(--line); padding: 6px 12px; margin: 14px 0 0;
}
.privacy-note { color: var(--muted); font-size: 13px; margin: 14px 0 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.learn { margin-top: 34px; color: var(--muted); font-size: 14px; }
.learn h2 { font-size: 15px; color: var(--ink); margin: 0 0 8px; }

footer.site { margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.hidden { display: none !important; }
