:root {
  color-scheme: light;
  --ink: #101624;
  --muted: #5d6a7f;
  --line: #d9e1ee;
  --panel: #ffffff;
  --soft: #eef4fb;
  --brand: #2846b8;
  --brand-strong: #14245f;
  --accent: #f3b735;
  --success: #187451;
  --danger: #a83737;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(238, 244, 251, 0.95), rgba(217, 227, 242, 0.9)),
    #edf3fb;
}

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

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

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: #fff;
  background: var(--brand-strong);
  font-weight: 800;
}

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

h1 {
  font-size: 24px;
}

.topbar p,
.upload-copy p,
.analysis-mode,
#summary {
  color: var(--muted);
  margin-top: 4px;
}

.analysis-mode {
  font-weight: 800;
}

.upload-panel,
.result {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(23, 36, 70, 0.12);
}

.upload-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(280px, 1.35fr) auto;
  align-items: center;
  gap: 18px;
  padding: 22px;
}

.drop-zone {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 24px;
  border: 1px dashed #9dafca;
  border-radius: 8px;
  background: var(--soft);
  cursor: pointer;
}

.drop-zone:hover {
  border-color: var(--brand);
  background: #e6eefb;
}

.drop-title {
  font-weight: 800;
  font-size: 18px;
}

.drop-detail,
.limits {
  color: var(--muted);
  font-size: 14px;
}

.actions {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.model-picker {
  display: grid;
  gap: 6px;
  width: 100%;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

button,
.download-button {
  appearance: none;
  border: 0;
  border-radius: 6px;
  padding: 12px 18px;
  background: var(--brand-strong);
  color: #fff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

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

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

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

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

.result {
  padding: 22px;
}

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

.eyebrow {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

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

.group-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
  margin-bottom: 8px;
}

.group-top h3 {
  font-size: 16px;
}

.group-top span {
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.group-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.group-card small {
  display: block;
  color: #748096;
  margin-top: 10px;
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 440px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
  background: #fff;
}

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

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

td {
  color: #344158;
  overflow-wrap: anywhere;
}

.hidden,
.sr-only {
  display: none;
}

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

  .upload-panel,
  .result-head {
    grid-template-columns: 1fr;
    display: grid;
  }

  .actions {
    justify-items: stretch;
  }

  button,
  select,
  .download-button {
    width: 100%;
    text-align: center;
  }
}
