:root {
  color-scheme: light;
  --red: #d71920;
  --red-dark: #9d1017;
  --ink: #151515;
  --muted: #686868;
  --line: #dedede;
  --paper: #ffffff;
  --soft: #f7f7f7;
  --black: #0f0f10;
  --shadow: 0 18px 45px rgba(20, 20, 20, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(215, 25, 32, 0.08), transparent 24rem),
    linear-gradient(180deg, #fff 0%, #f4f4f4 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 14px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(156, 15, 22, 0.22);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--red-dark);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 3.6vw, 3rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: 1rem;
  letter-spacing: 0;
}

.sample {
  max-width: 100%;
  overflow: hidden;
  padding: 10px 12px;
  border: 1px solid rgba(215, 25, 32, 0.28);
  border-radius: 8px;
  background: #fff;
  color: var(--red-dark);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.9rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(340px, 1.05fr);
  gap: 18px;
  align-items: stretch;
}

.controls,
.upload-panel,
.file-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field.short {
  grid-column: span 1;
}

.date-field {
  grid-column: span 1;
}

label {
  color: #303030;
  font-size: 0.8rem;
  font-weight: 750;
}

select,
input[type="text"],
input[type="number"] {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cfcfcf;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

select:focus,
input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.14);
}

.locked input {
  background: #f0f0f0;
  color: #4a4a4a;
  font-weight: 800;
}

.upload-panel {
  padding: 18px;
}

.drop-zone {
  display: grid;
  grid-template-columns: 6px minmax(0, 1fr);
  grid-template-areas:
    "line text"
    "line buttons";
  gap: 14px 16px;
  min-height: 154px;
  padding: 18px;
  border: 1px dashed #c9c9c9;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff 0%, #fafafa 70%, rgba(215, 25, 32, 0.06) 100%);
}

.drop-zone.dragging {
  border-color: var(--red);
  background: rgba(215, 25, 32, 0.06);
}

.bolt-line {
  grid-area: line;
  width: 6px;
  border-radius: 99px;
  background: linear-gradient(180deg, var(--red), var(--black));
}

.drop-zone h2 {
  margin-bottom: 6px;
  font-size: 1.25rem;
}

.drop-zone p {
  margin-bottom: 0;
  color: var(--muted);
}

.upload-actions {
  display: flex;
  flex-wrap: wrap;
  grid-area: buttons;
  gap: 10px;
  align-self: end;
}

.file-button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 7px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 800;
}

.file-button {
  min-width: 86px;
  background: var(--black);
  color: #fff;
  padding: 0 16px;
}

.file-button:hover {
  background: #2a2a2b;
}

.file-button input {
  display: none;
}

.command-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

button {
  padding: 0 18px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.primary {
  background: var(--red);
  color: #fff;
}

.primary:hover:not(:disabled) {
  background: var(--red-dark);
}

.download {
  border-color: var(--black);
  background: #fff;
  color: var(--black);
}

.download.ready {
  border-color: var(--red);
  color: var(--red-dark);
}

.progress-wrap {
  margin-top: 18px;
}

.progress-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: #e5e5e5;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), #2a2a2b);
  transition: width 160ms ease;
}

.file-list {
  margin-top: 18px;
  overflow: hidden;
}

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.list-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.check-all {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
}

.table-wrap {
  max-height: 440px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  border-bottom: 1px solid #ececec;
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
  color: #444;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

td {
  color: #2f2f2f;
  font-size: 0.9rem;
}

.original-name,
.generated-name {
  overflow-wrap: anywhere;
}

.generated-name {
  color: var(--red-dark);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-weight: 700;
}

.select-col {
  width: 46px;
  text-align: center;
}

.size-col {
  width: 106px;
  color: var(--muted);
  text-align: right;
}

.empty-row td {
  padding: 36px 18px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100% - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--black);
  color: #fff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.24);
  font-size: 0.9rem;
  font-weight: 700;
}

@media (max-width: 820px) {
  .topbar,
  .list-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .field.short,
  .date-field {
    grid-column: auto;
  }

  .sample {
    width: 100%;
  }

  .size-col {
    display: none;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 16px;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
  }

  .drop-zone {
    grid-template-columns: 1fr;
    grid-template-areas:
      "line"
      "text"
      "buttons";
  }

  .bolt-line {
    width: 100%;
    height: 5px;
  }

  .file-button,
  .command-row button {
    width: 100%;
  }

  th,
  td {
    padding: 10px 8px;
  }
}
