:root {
  color-scheme: light;
  --bg: #f7f3ee;
  --panel: #ffffff;
  --text: #23201d;
  --muted: #746b61;
  --line: #ded6cc;
  --accent: #216b64;
  --accent-strong: #174c47;
  --danger: #9c2f2f;
  --ok: #287a4b;
  --shadow: 0 18px 55px rgba(35, 32, 29, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(247, 243, 238, 0.92)),
    url("https://images.unsplash.com/photo-1519741497674-611481863552?auto=format&fit=crop&w=1800&q=80");
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--accent-strong);
}

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

button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

button.secondary:hover {
  background: #f3eee8;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: var(--text);
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

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

.shell.wide {
  width: min(1120px, calc(100% - 32px));
}

.intro {
  min-height: 34vh;
  display: flex;
  flex-direction: column;
  justify-content: end;
  padding: 24px 0;
}

.intro.compact {
  min-height: 18vh;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 11ch;
  margin-bottom: 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 13vw, 6.8rem);
  line-height: 0.92;
  font-weight: 500;
}

h2 {
  margin-bottom: 0;
  font-size: 1.2rem;
}

.lede {
  max-width: 560px;
  margin-bottom: 0;
  color: #3c3630;
  font-size: 1.1rem;
  line-height: 1.55;
}

.panel {
  margin-top: 16px;
  border: 1px solid rgba(222, 214, 204, 0.88);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hidden {
  display: none !important;
}

.name-row,
.identity-row,
.section-title {
  display: flex;
  gap: 12px;
  align-items: center;
}

.name-row input {
  flex: 1;
}

.identity-row,
.section-title {
  justify-content: space-between;
  margin-bottom: 16px;
}

.muted,
small {
  color: var(--muted);
}

.file-picker {
  display: flex;
  min-height: 138px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px dashed #b9aca0;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
}

.file-picker span {
  font-size: 1.05rem;
  font-weight: 800;
}

#fileInput {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.notice {
  margin-top: 14px;
  border-left: 4px solid var(--accent);
  padding: 12px 14px;
  background: #eef7f5;
  color: #214541;
  line-height: 1.45;
}

.form-status {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.form-status.error {
  color: var(--danger);
}

.queue,
.uploads-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.upload-card,
.upload-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.upload-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.filename {
  overflow-wrap: anywhere;
  font-weight: 800;
}

.status {
  color: var(--muted);
  white-space: nowrap;
}

.status.ok {
  color: var(--ok);
}

.status.error {
  color: var(--danger);
}

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

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

.upload-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.summary-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.summary-card strong {
  display: block;
  font-size: 1.4rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 880px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.86rem;
}

@media (max-width: 640px) {
  body {
    background-attachment: scroll;
  }

  .shell {
    width: min(100% - 24px, 720px);
    padding: 18px 0;
  }

  .intro {
    min-height: 28vh;
  }

  .name-row,
  .identity-row,
  .section-title,
  .upload-head,
  .upload-meta {
    align-items: stretch;
    flex-direction: column;
  }

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