:root {
  --ink: #171717;
  --muted: #57625c;
  --line: #c5d0ca;
  --paper: #eef3f0;
  --panel: #fbfcfa;
  --accent: #0f766e;
  --accent-2: #b45309;
  --danger: #a52828;
  --ok: #166534;
  --shadow: 0 18px 48px rgba(12, 26, 20, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(23, 23, 23, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(23, 23, 23, 0.03) 1px, transparent 1px),
    var(--paper);
  background-size: 26px 26px;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: white;
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
  border-radius: 6px;
}

button.secondary {
  background: transparent;
  color: var(--ink);
}

button.danger {
  background: var(--danger);
  border-color: var(--danger);
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  min-height: 40px;
  padding: 9px 10px;
  border-radius: 6px;
}

label {
  display: grid;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
}

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

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 16px;
  margin-bottom: 22px;
}

.brandmark {
  display: flex;
  gap: 12px;
  align-items: center;
}

.stamp {
  width: 42px;
  height: 42px;
  border: 2px solid var(--ink);
  display: grid;
  place-items: center;
  font-weight: 900;
  transform: rotate(-3deg);
  background: #f7faf8;
}

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

h1 {
  font-size: clamp(30px, 5vw, 58px);
  line-height: 0.95;
  margin-bottom: 8px;
}

h2 {
  font-size: 24px;
  margin-bottom: 12px;
}

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

.grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
}

.panel {
  background: rgba(251, 252, 250, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.stack {
  display: grid;
  gap: 12px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.statline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.stat {
  border-top: 3px solid var(--ink);
  padding-top: 8px;
}

.stat strong {
  display: block;
  font-size: 26px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 14px;
}

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

th {
  background: #dfe9e4;
  position: sticky;
  top: 0;
  z-index: 1;
}

a {
  color: var(--ink);
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 12px;
}

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

.pill.off {
  color: var(--danger);
}

.upload-stage {
  min-height: 62vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: stretch;
}

.dropzone {
  min-height: 360px;
  border: 2px dashed var(--ink);
  border-radius: 8px;
  background: rgba(251, 252, 250, 0.86);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 28px;
}

.dropzone.active {
  outline: 4px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

.file-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

progress {
  width: 100%;
  height: 10px;
  accent-color: var(--accent);
}

.hidden {
  display: none !important;
}

@media (max-width: 820px) {
  .grid,
  .upload-stage {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .statline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
