:root {
  color-scheme: light;
  --ink: #14191d;
  --muted: #64717a;
  --paper: #f3f0e8;
  --panel: #fffdf8;
  --line: #d8d1c3;
  --steel: #23465b;
  --blue: #245da6;
  --brick: #9b3d2e;
  --green: #287556;
  --gold: #c39b4b;
  --soft-blue: #e9f0f8;
  --soft-red: #f7eae6;
  --shadow: 0 22px 60px rgba(20, 25, 29, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Serif SC", "Songti SC", Georgia, serif;
}

body {
  margin: 0;
  min-width: 320px;
}

button,
input {
  font: inherit;
}

button,
a,
.upload-dropzone {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

.transfer-header {
  align-items: center;
  background: rgba(243, 240, 232, 0.94);
  border-bottom: 1px solid rgba(20, 25, 29, 0.12);
  display: flex;
  justify-content: space-between;
  min-height: 76px;
  padding: 14px clamp(18px, 4vw, 54px);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
}

.transfer-brand {
  align-items: center;
  display: inline-flex;
  gap: 12px;
}

.brand-mark {
  align-items: center;
  background: var(--ink);
  color: var(--panel);
  display: inline-flex;
  font-family: "Segoe UI", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.transfer-brand strong,
.transfer-brand small {
  display: block;
}

.transfer-brand strong {
  font-size: 1rem;
}

.transfer-brand small {
  color: var(--muted);
  font-family: "Segoe UI", sans-serif;
  font-size: 0.74rem;
  margin-top: 2px;
}

.header-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.text-command,
.primary-command,
.secondary-command,
.queue-command,
.file-command {
  border-radius: 6px;
  font-family: "Segoe UI", sans-serif;
  font-weight: 800;
  min-height: 42px;
  padding: 0 15px;
}

.text-command {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  display: inline-flex;
  justify-content: center;
}

button.text-command {
  color: inherit;
}

.text-command:hover,
.text-command:focus-visible {
  border-color: var(--line);
  outline: none;
}

.danger-command {
  color: var(--brick) !important;
}

.transfer-main {
  margin: 0 auto;
  max-width: 1540px;
  padding: clamp(32px, 5vw, 72px) clamp(18px, 4vw, 56px) 72px;
}

.locked-view {
  margin: clamp(40px, 9vh, 110px) auto 0;
  max-width: 780px;
}

.section-kicker,
.panel-index {
  color: var(--brick);
  font-family: "Segoe UI", sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 14px;
}

.locked-view h1,
.workspace-heading h1 {
  font-size: clamp(2.8rem, 7vw, 6rem);
  letter-spacing: 0;
  line-height: 1;
  margin: 0;
}

.locked-copy {
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.85;
  margin: 24px 0 34px;
  max-width: 650px;
}

.access-form {
  border-block: 1px solid var(--line);
  padding: 28px 0;
}

.access-form label {
  display: block;
  font-weight: 800;
  margin-bottom: 10px;
}

.access-row {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.access-row input {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  min-height: 52px;
  padding: 0 16px;
  width: 100%;
}

.access-row input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(36, 93, 166, 0.12);
  outline: none;
}

.primary-command {
  background: var(--ink);
  border: 1px solid var(--ink);
  color: white;
  min-height: 52px;
}

.primary-command:hover,
.primary-command:focus-visible {
  background: var(--steel);
  border-color: var(--steel);
  outline: none;
}

button:disabled {
  cursor: progress;
  opacity: 0.58;
}

.form-message,
.list-message {
  color: var(--muted);
  font-family: "Segoe UI", sans-serif;
  line-height: 1.6;
  margin: 12px 0 0;
  min-height: 1.6em;
}

.form-message.is-error,
.list-message.is-error {
  color: var(--brick);
  font-weight: 700;
}

.workspace-heading {
  align-items: end;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 0.72fr) minmax(320px, 1.28fr);
  padding-bottom: 30px;
}

.workspace-heading > p {
  color: var(--muted);
  line-height: 1.8;
  margin: 0;
  max-width: 720px;
}

.transfer-workspace {
  display: grid;
  gap: 0;
  grid-template-columns: minmax(340px, 0.82fr) minmax(520px, 1.18fr);
}

.upload-panel,
.files-panel {
  min-width: 0;
  padding: clamp(26px, 3vw, 42px) 0;
}

.upload-panel {
  border-right: 1px solid var(--line);
  padding-right: clamp(24px, 3vw, 44px);
}

.files-panel {
  padding-left: clamp(24px, 3vw, 44px);
}

.panel-heading {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  min-height: 54px;
}

.panel-heading > div {
  align-items: baseline;
  display: flex;
  gap: 12px;
}

.panel-heading h2 {
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  margin: 0;
}

.panel-index {
  margin: 0;
}

.retention-note {
  color: var(--muted);
  font-family: "Segoe UI", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
}

.secondary-command,
.queue-command,
.file-command {
  background: var(--soft-blue);
  border: 1px solid transparent;
  color: var(--steel);
}

.secondary-command:hover,
.secondary-command:focus-visible,
.queue-command:hover,
.queue-command:focus-visible,
.file-command:hover,
.file-command:focus-visible {
  border-color: rgba(36, 93, 166, 0.34);
  outline: none;
}

.upload-dropzone {
  align-items: center;
  background: var(--panel);
  border: 1px dashed #a9a08f;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-top: 22px;
  min-height: 230px;
  padding: 30px;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease;
}

.upload-dropzone:hover,
.upload-dropzone:focus-within,
.upload-dropzone.is-dragging {
  background: #f8fbff;
  border-color: var(--blue);
}

.upload-dropzone input {
  height: 1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.dropzone-mark {
  color: var(--brick);
  font-family: "Segoe UI", sans-serif;
  font-size: 2.4rem;
  line-height: 1;
}

.upload-dropzone strong {
  font-size: 1.18rem;
  margin-top: 16px;
}

.upload-dropzone > span:last-child {
  color: var(--muted);
  font-family: "Segoe UI", sans-serif;
  font-size: 0.87rem;
  line-height: 1.65;
  margin-top: 8px;
  max-width: 390px;
}

.upload-queue,
.file-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.empty-note {
  border-top: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
  padding: 22px 0;
}

.queue-item,
.file-row {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.queue-item {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.queue-title,
.file-name {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.queue-meta,
.file-meta,
.queue-status {
  color: var(--muted);
  font-family: "Segoe UI", sans-serif;
  font-size: 0.82rem;
  line-height: 1.5;
}

.progress-track {
  background: #e6e1d7;
  height: 6px;
  overflow: hidden;
}

.progress-bar {
  background: var(--blue);
  height: 100%;
  transition: width 140ms ease;
  width: 0;
}

.queue-item[data-status="completed"] .progress-bar {
  background: var(--green);
}

.queue-item[data-status="error"] .queue-status {
  color: var(--brick);
}

.queue-actions,
.file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.queue-command,
.file-command {
  min-height: 38px;
  padding: 0 12px;
}

.queue-command.cancel,
.file-command.delete {
  background: var(--soft-red);
  color: var(--brick);
}

.file-row {
  align-items: center;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(190px, 1.4fr) minmax(90px, 0.45fr) minmax(140px, 0.72fr) minmax(140px, 0.72fr) auto;
  padding: 14px 16px;
}

.file-meta-label {
  color: var(--muted);
  display: none;
  font-size: 0.74rem;
  margin-bottom: 3px;
}

.file-actions {
  justify-content: flex-end;
}

.file-command.download {
  background: var(--ink);
  color: white;
}

@media (max-width: 1080px) {
  .transfer-workspace {
    grid-template-columns: minmax(300px, 0.72fr) minmax(440px, 1.28fr);
  }

  .file-row {
    grid-template-columns: minmax(180px, 1fr) minmax(84px, 0.4fr) minmax(130px, 0.65fr) auto;
  }

  .file-expiry {
    display: none;
  }
}

@media (max-width: 760px) {
  .transfer-header {
    align-items: flex-start;
    gap: 12px;
  }

  .header-actions {
    justify-content: flex-end;
  }

  .text-command {
    min-height: 38px;
    padding: 0 9px;
  }

  .transfer-main {
    padding-top: 34px;
  }

  .access-row,
  .workspace-heading,
  .transfer-workspace {
    grid-template-columns: 1fr;
  }

  .workspace-heading {
    align-items: start;
  }

  .upload-panel {
    border-bottom: 1px solid var(--line);
    border-right: 0;
    padding-right: 0;
  }

  .files-panel {
    padding-left: 0;
  }

  .upload-dropzone {
    min-height: 190px;
  }

  .file-row {
    align-items: start;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .file-name,
  .file-actions {
    grid-column: 1 / -1;
  }

  .file-expiry {
    display: block;
  }

  .file-meta-label {
    display: block;
  }

  .file-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .transfer-header {
    align-items: stretch;
    display: grid;
  }

  .header-actions {
    justify-content: space-between;
  }

  .locked-view h1,
  .workspace-heading h1 {
    font-size: 2.8rem;
  }

  .panel-heading {
    align-items: flex-start;
  }

  .file-row {
    grid-template-columns: 1fr;
  }

  .file-name,
  .file-actions {
    grid-column: auto;
  }

  .queue-actions,
  .file-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
