:root {
  color-scheme: light;
  font-family: "Proxima Nova", "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  color: #2c3e50;
  background: #f9f9fb;
  --accent: #0061ff;
  --border: #dce4ec;
  --muted: #62748e;
  --danger: #a12636;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

body {
  margin: 0;
  border-top: 5px solid #45bbff;
}

main {
  max-width: 860px;
  padding: 36px 28px;
  margin: 0 auto;
}

header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 24px;
}

.brand-logo {
  display: block;
  width: 132px;
  height: auto;
  margin-bottom: 20px;
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
}

h1 {
  font-size: 30px;
  line-height: 1.2;
  margin: 8px 0 16px;
  font-weight: 700;
}

h2 {
  font-size: 18px;
  margin: 0;
}

h3 {
  font-size: 15px;
  margin: 0;
  font-weight: 650;
}

p {
  line-height: 1.5;
}

#session-status {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 16px;
}

#session-status:last-child {
  margin-bottom: 0;
}

button,
textarea {
  font: inherit;
  border-radius: 3px;
}

button {
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: #0052d6;
}

button.secondary {
  background: #fff;
  border-color: #bed0df;
  color: #2c3e50;
}

button.secondary:hover:not(:disabled) {
  background: #eaf5ff;
}

button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

:focus-visible {
  outline: 3px solid #45bbff;
  outline-offset: 3px;
}

button,
.file-state {
  overflow-wrap: anywhere;
}

#notice {
  color: var(--danger);
  background: #fff0f2;
  border-left: 3px solid var(--danger);
  padding: 12px 16px;
  font-size: 14px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 24px 0 16px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

#file-count {
  display: inline-block;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 6px;
}

#drop-zone {
  border: 1px dashed #b5cadb;
  min-height: 96px;
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #fff;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

#drop-zone.dragging {
  background: #eaf5ff;
  border-color: var(--accent);
}

#drop-zone[aria-disabled="true"] {
  cursor: default;
  opacity: .55;
}

.file-mark {
  flex: 0 0 22px;
  height: 28px;
  border: 2px solid #7b95a9;
  border-radius: 2px;
  background: repeating-linear-gradient(to bottom, transparent 0 5px, #c0cdda 5px 6px, transparent 6px 9px) center / 12px 18px no-repeat;
}

#files {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
}

.file-row {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.file-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.file-identity {
  min-width: 0;
}

.file-name {
  overflow-wrap: anywhere;
}

.file-name-line {
  display: flex;
  align-items: center;
  gap: 4px;
}

button.remove {
  flex: 0 0 44px;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--danger);
  font-size: 24px;
  font-weight: 400;
}

button.remove:hover:not(:disabled) {
  background: #fff0f2;
}

.file-size {
  display: block;
  font-size: 12px;
  margin-top: 4px;
  color: var(--muted);
}

.file-state {
  flex-shrink: 0;
  max-width: 45%;
  font-size: 12px;
  font-weight: 650;
  padding: 5px 8px;
  background: #eaf0f6;
  border-radius: 2px;
}

.file-row[data-state="Uploaded"] .file-state {
  color: #135437;
  background: #d7eddf;
}

.file-row[data-state="Failed"] .file-state {
  color: #8d1d2c;
  background: #f8e2e7;
}

.batch-notes {
  margin: 24px 0 16px;
}

#submitted-notes {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.notes-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  margin-bottom: 6px;
}

#notes-count {
  color: var(--muted);
}

#notes-error {
  color: var(--danger);
  font-size: 13px;
}

textarea {
  display: block;
  width: 100%;
  min-height: 64px;
  resize: vertical;
  padding: 10px;
  background: #fff;
  border: 1px solid #b8c8d6;
  color: inherit;
  line-height: 1.5;
}

textarea:disabled {
  background: #eef2f6;
  color: var(--muted);
  opacity: 1;
}

.transfer-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
}

.percentage {
  min-width: 4ch;
  text-align: right;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

progress {
  display: block;
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 8px;
  accent-color: var(--accent);
}

progress::-webkit-progress-bar {
  background: #e3eaf1;
  border-radius: 2px;
}

progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 2px;
}

progress::-moz-progress-bar {
  background: var(--accent);
}

.file-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.file-message {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  overflow-wrap: anywhere;
}

.file-row[data-state="Failed"] .file-message {
  color: var(--danger);
}

.file-footer .actions {
  flex-shrink: 0;
}

#summary {
  color: var(--muted);
  font-size: 13px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 520px) {
  main {
    padding: 24px 16px;
  }

  h1 {
    font-size: 26px;
  }

  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar .actions {
    width: 100%;
  }

  .toolbar button {
    flex: 1;
    padding-inline: 10px;
  }

  .file-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .file-footer .actions {
    width: 100%;
  }

  .file-heading {
    gap: 8px;
  }

  #upload {
    width: 100%;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .file-row {
    animation: appear .18s ease-out;
  }

  @keyframes appear {
    from {
      opacity: 0;
      transform: translateY(4px);
    }

    to {
      opacity: 1;
      transform: none;
    }
  }
}