:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  color: #18181b;
  background: #fff;
  --muted: #71717a;
  --line: #e4e4e7;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .5; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid #71717a; outline-offset: 4px; }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }
[hidden] { display: none !important; }

.header, main { width: min(100% - 48px, 680px); margin: 0 auto; }
.header { min-height: 80px; display: flex; justify-content: space-between; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); }
.brand { font-size: 17px; font-weight: 600; letter-spacing: -.4px; }
.session-controls { display: flex; align-items: center; gap: 24px; min-width: 0; }
.text-button { padding: 8px 0; border: 0; background: none; color: var(--muted); font-size: 12px; white-space: nowrap; }
.text-button:hover { color: #18181b; }
.loading { padding: 80px 0; text-align: center; font-size: 14px; color: var(--muted); }
.upload-view { padding: 56px 0; }
h1 { font-size: 22px; line-height: 1.3; font-weight: 500; letter-spacing: -.5px; }

.dropzone { min-height: 220px; margin-top: 24px; padding: 36px 24px; border: 1px dashed #d4d4d8; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; transition: border-color .15s, background .15s; }
.dropzone.dragging { background: #fafafa; border-color: #18181b; }
.primary-button { min-height: 40px; padding: 10px 18px; border: 1px solid #18181b; border-radius: 6px; background: #18181b; color: #fff; font-size: 13px; font-weight: 500; }
.primary-button:hover { background: #333336; }
.dropzone p { margin-top: 14px; font-size: 13px; color: var(--muted); }
.size-limit { margin-top: 9px; font-size: 11px; color: var(--muted); }
.selection-message, .form-error { margin-top: 12px; color: #b42318; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }

.queue-section { margin-top: 28px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); }
.section-heading h2 { font-size: 13px; font-weight: 500; }
.count { margin-left: 6px; color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.queue { list-style: none; padding: 0; margin: 0; }
.file-row { display: flex; align-items: center; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.file-main { min-width: 0; flex: 1; }
.file-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 400; }
.file-percent { flex-shrink: 0; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.file-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; font-size: 11px; line-height: 1.5; color: var(--muted); }
.file-progress { display: block; width: 100%; height: 2px; margin-top: 10px; border: 0; border-radius: 0; appearance: none; background: #f1f1f2; overflow: hidden; }
.file-progress::-webkit-progress-bar { background: #f1f1f2; }
.file-progress::-webkit-progress-value { background: #52525b; }
.file-progress::-moz-progress-bar { background: #52525b; }
.file-actions { flex-shrink: 0; text-align: right; }
.file-error { display: block; margin-top: 6px; font-size: 11px; line-height: 1.5; color: #b42318; overflow-wrap: anywhere; }
.file-row[data-status="error"] .file-state { color: #b42318; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.login-view { max-width: 320px; margin: 80px auto; }
.login-form { margin-top: 28px; }
.login-form label { display: block; margin-bottom: 9px; color: var(--muted); font-size: 12px; }
.token-field { display: flex; border: 1px solid #d4d4d8; border-radius: 6px; }
.token-field:focus-within { border-color: #71717a; }
.token-field input { width: 100%; min-width: 0; padding: 12px; border: 0; border-radius: 6px; background: none; color: inherit; font-size: 13px; }
.token-field input::placeholder { color: var(--muted); }
.token-field button { flex-shrink: 0; padding: 0 12px; border: 0; background: none; color: var(--muted); font-size: 11px; }
.login-form > .primary-button { width: 100%; margin-top: 16px; }

@media (max-width: 480px) {
  .header, main { width: calc(100% - 40px); }
  .header { min-height: 68px; gap: 16px; }
  .session-controls { gap: 16px; }
  .upload-view { padding-top: 36px; }
  h1 { font-size: 20px; }
  .dropzone { min-height: 210px; margin-top: 20px; padding: 28px 16px; }
  .file-row { gap: 16px; }
  .file-actions .text-button { font-size: 11px; }
  .login-view { margin-top: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
