:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --panel: rgba(255, 255, 255, 0.82);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.08);
  --blue: #0071e3;
  --green: #1d8f55;
  --red: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at 20% 0%, rgba(0, 113, 227, 0.12), transparent 30%),
    linear-gradient(180deg, #fbfbfd 0%, var(--bg) 100%);
  color: var(--text);
}

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

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 32px;
  background: var(--panel);
  backdrop-filter: blur(28px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.08);
}

.login-panel h1 {
  font-size: 36px;
  line-height: 1.12;
}

.login-form {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.login-form label {
  color: var(--muted);
  font-weight: 700;
}

.login-form input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  font: inherit;
  outline: none;
}

.login-form input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

.login-form p {
  margin: 0;
  color: var(--red);
  font-weight: 700;
}

.workspace {
  display: grid;
  gap: 22px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.logout-link {
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: clamp(32px, 6vw, 64px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: 0;
}

.upload-panel,
.results {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(28px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.08);
}

.upload-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: stretch;
  padding: 16px;
  border-radius: 8px;
}

.drop-zone {
  min-height: 150px;
  border: 1px dashed rgba(0, 0, 0, 0.18);
  border-radius: 8px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.drop-zone:hover {
  border-color: var(--blue);
  background: rgba(0, 113, 227, 0.04);
}

.drop-zone input {
  display: none;
}

.drop-zone strong {
  max-width: 100%;
  padding: 0 14px;
  color: var(--text);
  font-size: 20px;
  overflow-wrap: anywhere;
}

.upload-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--blue);
  font-size: 28px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.upload-status {
  grid-column: 1 / -1;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #a1a1a6;
}

.upload-status.ready,
.upload-status.working {
  color: var(--blue);
  background: rgba(0, 113, 227, 0.08);
}

.upload-status.ready .status-dot,
.upload-status.working .status-dot {
  background: var(--blue);
}

.upload-status.working .status-dot {
  animation: pulse 1s ease-in-out infinite;
}

.upload-status.done {
  color: var(--green);
  background: rgba(29, 143, 85, 0.12);
}

.upload-status.done .status-dot {
  background: var(--green);
}

.upload-status.error {
  color: var(--red);
  background: rgba(180, 35, 24, 0.1);
}

.upload-status.error .status-dot {
  background: var(--red);
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.5);
    opacity: 0.55;
  }
}

button,
.download-button,
.primary-download {
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-grid;
  place-items: center;
  min-height: 48px;
  padding: 0 24px;
}

button:disabled {
  cursor: default;
  opacity: 0.65;
}

.message {
  min-height: 24px;
  color: var(--muted);
  font-weight: 600;
}

.message.success {
  color: var(--green);
}

.message.error {
  color: var(--red);
}

.primary-download {
  justify-self: start;
  min-width: 220px;
  box-shadow: 0 12px 28px rgba(0, 113, 227, 0.24);
}

.primary-download[hidden] {
  display: none;
}

.results {
  border-radius: 8px;
  overflow: hidden;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr)) auto;
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.summary > div,
.summary > a {
  background: rgba(255, 255, 255, 0.72);
  padding: 18px;
}

.summary span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.summary strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
}

.download-button {
  align-self: stretch;
  border-radius: 0;
}

.table-wrap {
  max-height: 58vh;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.75);
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(250, 250, 252, 0.95);
  color: var(--muted);
  font-size: 13px;
}

.poizon {
  font-weight: 700;
}

.pill {
  display: inline-grid;
  place-items: center;
  min-width: 64px;
  min-height: 28px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.pill.ok {
  color: var(--green);
  background: rgba(29, 143, 85, 0.12);
}

.pill.miss {
  color: var(--red);
  background: rgba(180, 35, 24, 0.1);
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding: 24px 0;
  }

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

  button,
  .download-button,
  .primary-download {
    width: 100%;
  }

  th,
  td {
    padding: 12px;
  }
}
