:root { color-scheme: light; --ink: #222; --muted: #666; --line: #dedede; --soft: #f7f7f7; }
* { box-sizing: border-box; }
html { background: #fff; }
body {
  min-height: 100vh; margin: 0; padding: 1.5rem; background: #fff; color: var(--ink);
  font-family: Arial, sans-serif; opacity: 0; transition: opacity 260ms ease;
  -webkit-font-smoothing: antialiased;
}
body.ready { opacity: 1; }
body.leaving { opacity: 0; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, .dropzone:focus-within { outline: 2px solid var(--ink); outline-offset: 4px; }
h1 { margin: 0; font-size: clamp(2.5rem, 9vw, 4.5rem); letter-spacing: -.06em; line-height: 1; }
p { margin: 1rem 0 0; color: var(--muted); font-size: 1.1rem; line-height: 1.6; }
.home { display: grid; min-height: calc(100vh - 3rem); max-width: 34rem; margin: 0 auto; place-content: center; justify-items: center; text-align: center; }
.button {
  display: inline-flex; min-height: 2.8rem; align-items: center; justify-content: center; gap: .75rem;
  border: 1px solid var(--ink); border-radius: 0; background: var(--ink); color: #fff;
  font: 600 .9rem Arial, sans-serif; text-decoration: none; cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.button:hover { background: #fff; color: var(--ink); }
.home .button { margin-top: 2rem; padding: 0 1.15rem; }
.uploader { width: min(100%, 34rem); margin: 0 auto; padding: clamp(2rem, 8vh, 5rem) 0; }
.back { display: inline-block; margin-bottom: clamp(4rem, 12vh, 7rem); color: var(--muted); font-size: .85rem; text-decoration: none; }
.back:hover { color: var(--ink); }
.uploader header { text-align: center; }
.uploader header p { font-size: 1rem; }
form { margin-top: 2.5rem; }
.dropzone {
  display: grid; min-height: 12rem; padding: 2rem; place-content: center; border: 1px dashed #b7b7b7;
  background: #fff; text-align: center; cursor: pointer; transition: border-color 160ms ease, background 160ms ease;
}
.dropzone:hover, .dropzone.dragging { border-color: var(--ink); background: var(--soft); }
.dropzone input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.drop-title { font-size: 1rem; font-weight: 600; }
.drop-copy { margin-top: .55rem; color: var(--muted); font-size: .8rem; }
.selected { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.selected span:first-child { overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.compatibility { margin: .7rem 0 0; color: #8a5700; font-size: .8rem; text-align: center; }
.options-row { display: grid; grid-template-columns: 1fr 8rem; gap: .75rem; margin-top: 1.25rem; }
.options-row label { display: grid; gap: .5rem; }
.options-row span, .key-field span { color: var(--muted); font-size: .75rem; }
.options-row small { font-size: inherit; font-weight: normal; }
.options-row input, .options-row select { min-width: 0; height: 2.8rem; padding: 0 .8rem; border: 1px solid var(--line); border-radius: 0; background: #fff; color: var(--ink); font: inherit; }
.key-field { display: grid; gap: .5rem; margin-top: 1.25rem; }
.key-field input, .url-row input { min-width: 0; height: 2.8rem; padding: 0 .8rem; border: 1px solid var(--line); border-radius: 0; background: #fff; color: var(--ink); font: inherit; }
.upload-button { width: 100%; margin-top: 1rem; }
.upload-button:disabled { cursor: wait; opacity: .55; }
.progress { height: 2px; margin-top: 1rem; overflow: hidden; background: var(--line); opacity: 0; }
.progress.active { opacity: 1; }
.progress span { display: block; width: 0; height: 100%; background: var(--ink); transition: width 150ms linear; }
.status { min-height: 1.5rem; margin-top: .7rem; font-size: .8rem; text-align: center; }
.status.error { color: #a5261d; }
.result { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.result h2 { margin: 0 0 .8rem; font-size: .85rem; font-weight: 600; }
.url-row { display: grid; grid-template-columns: 1fr auto; }
.url-row input { border-right: 0; font-size: .8rem; }
.url-row button { padding: 0 1rem; border: 1px solid var(--ink); border-radius: 0; background: #fff; font: 600 .8rem Arial, sans-serif; cursor: pointer; }
.url-row button:hover { background: var(--ink); color: #fff; }
.result > a { display: inline-block; margin-top: .9rem; color: var(--muted); font-size: .8rem; text-underline-offset: 3px; }
.text-button { padding: 0; border: 0; background: none; color: var(--muted); font: .8rem Arial, sans-serif; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.result .text-button { margin: .9rem 0 0 1rem; }
.library { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: center; justify-content: space-between; }
.section-heading h2 { margin: 0; font-size: .85rem; }
.storage { margin-top: 1rem; }
.storage > div:first-child { display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; }
.meter { height: 2px; margin-top: .6rem; background: var(--line); }
.meter span { display: block; width: 0; height: 100%; background: var(--ink); }
.library-status { min-height: 1rem; margin-top: .8rem; font-size: .75rem; }
.file-list { margin: .5rem 0 0; padding: 0; list-style: none; }
.file-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .75rem; align-items: center; padding: .8rem 0; border-top: 1px solid var(--line); font-size: .78rem; }
.file-list a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { color: var(--muted); white-space: nowrap; }
@media (max-width: 30rem) { .options-row { grid-template-columns: 1fr; } .file-list { font-size: .72rem; } .file-meta { display: none; } }
@media (prefers-reduced-motion: reduce) { body { transition: none; } }
