:root {
  color-scheme: light dark;
  --bg: #fafaf9;
  --text: #1c1917;
  --muted: #57534e;
  --line: #e7e5e4;
  --surface: #ffffff;
  --accent: #1e3a5f;
  --accent-ink: #ffffff;
  --bad: #991b1b;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --text: #ecebea;
    --muted: #b5b0ab;
    --line: #2e2e2e;
    --surface: #1c1c1c;
    --accent: #8fb3dd;
    --accent-ink: #0f1a26;
    --bad: #fca5a5;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); }
main { max-width: 36rem; margin: 0 auto; padding: max(1.25rem, env(safe-area-inset-top)) 1.25rem 2.5rem; }
h1 { font-size: 1.5rem; font-weight: 650; line-height: 1.25; margin: 0 0 1rem; }
.logo { display: block; width: min(18rem, 100%); height: auto; background: #fff; border-radius: 8px; }
h1 a { display: inline-block; }
footer { margin-top: 2.25rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: 0.95rem; }
footer a { color: var(--accent); }
.about p { margin: 0 0 0.9rem; }
.about h2 { margin-top: 1.25rem; }
.about ul { list-style: disc; margin: 0.4rem 0 0.9rem; padding-left: 1.25rem; }
.about li { margin: 0.25rem 0; }
h2 { font-size: 1.05rem; font-weight: 650; margin: 0 0 0.75rem; }
section + section { margin-top: 1.75rem; }
[hidden] { display: none !important; }
.upload, .actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.drop, .card { border: 1px solid var(--line); border-radius: 8px; padding: 0.75rem; }
.drop { border-style: dashed; }
.drop.dragover { border-color: var(--accent); background: var(--surface); }
.card + .card { margin-top: 0.75rem; }
.hint { margin: 0.6rem 0 0; color: var(--muted); font-size: 0.9rem; }
#queue { margin: 0.75rem 0 0; }
#queue:empty { display: none; }
progress { width: 100%; height: 0.45rem; accent-color: var(--accent); }
label { display: block; font-weight: 600; margin-top: 0.75rem; }
input[type="text"], input[type="file"] {
  font: inherit;
  width: 100%;
  max-width: 100%;
  margin-top: 0.3rem;
}
input[type="text"] {
  min-height: 44px;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}
.code { margin: 0.15rem 0 0.5rem; font-size: 1.5rem; font-weight: 650; letter-spacing: 0.14em; font-variant-numeric: tabular-nums; }
.btn, button {
  font: inherit;
  font-size: 0.95rem;
  min-height: 44px;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
#upload, #get-btn { margin-top: 0.75rem; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.danger { color: var(--bad); border-color: var(--bad); background: var(--surface); }
button:disabled { opacity: 0.55; cursor: default; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
#send-status, #get-status { min-height: 1.5em; margin: 0.75rem 0 0; color: var(--muted); overflow-wrap: anywhere; }
#send-status.error, #get-status.error, .meta.error { color: var(--bad); }
ul { list-style: none; padding: 0; margin: 0.75rem 0 0; }
.file { border-top: 1px solid var(--line); padding: 0.85rem 0; }
.name { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.meta { margin: 0.15rem 0 0.55rem; color: var(--muted); font-size: 0.9rem; }
.empty { color: var(--muted); padding: 0.5rem 0; }
@media (max-width: 40rem) {
  .actions { flex-direction: column; align-items: stretch; }
  .btn, button, input[type="file"] { width: 100%; }
}
