:root {
  color-scheme: light;
  --blue-950: #08152c;
  --blue-900: #102448;
  --blue-800: #1a5faf;
  --blue-700: #2472d0;
  --blue-100: #dcecff;
  --blue-50: #eef6ff;
  --green-600: #198754;
  --green-50: #e9f8f1;
  --orange-600: #d97706;
  --orange-50: #fff4df;
  --red-600: #c73636;
  --red-50: #fff0f0;
  --ink: #101828;
  --muted: #64748b;
  --line: #dbe4f0;
  --soft: #f7f9fc;
  --white: #ffffff;
  --shadow: 0 18px 55px rgba(36, 114, 208, 0.12);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff 0, #f5f9ff 460px, #ffffff 100%);
  font-size: 16px;
  line-height: 1.5;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

h1,
h2,
h3 {
  color: var(--blue-950);
  letter-spacing: 0;
  line-height: 1.12;
}

h1 {
  max-width: 780px;
  font-size: 2.35rem;
}

h2 {
  font-size: 1.38rem;
}

h3 {
  font-size: 1rem;
}

svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(219, 228, 240, 0.95);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 28px rgba(36, 114, 208, 0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--blue-950);
  font-weight: 850;
}

.brand img {
  display: block;
  width: min(210px, 42vw);
  height: auto;
}

.brand span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-left: 1px solid var(--line);
  padding-left: 12px;
  color: var(--blue-700);
  white-space: nowrap;
}

.top-actions,
.panel-heading,
.result-head,
.file-row,
.metric-grid,
.filter-row,
.table-head,
.check-grid,
.document-grid,
.status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.mode-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 11px;
  color: #40516a;
  background: var(--white);
  font-size: 0.88rem;
  font-weight: 750;
  white-space: nowrap;
}

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

.workspace {
  display: grid;
  grid-template-columns: minmax(340px, 440px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.input-panel {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 18px;
  padding: 20px;
}

.result-panel {
  display: grid;
  gap: 18px;
  min-height: 620px;
  padding: 22px;
}

.section-head {
  display: grid;
  gap: 8px;
}

.section-head p,
.muted,
.hint {
  color: #50627d;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue-700);
  font-size: 0.85rem;
  font-weight: 850;
}

.eyebrow::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-600);
  content: "";
}

.upload-stack,
.result-stack,
.check-list,
.note-list {
  display: grid;
  gap: 14px;
}

.upload-box {
  display: grid;
  gap: 10px;
  min-height: 132px;
  border: 1px dashed #b9cbe5;
  border-radius: var(--radius);
  padding: 16px;
  background: var(--soft);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.upload-box.dragging {
  border-color: var(--blue-700);
  background: var(--blue-50);
  transform: translateY(-1px);
}

.upload-label {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.upload-label strong {
  display: block;
  color: var(--blue-950);
}

.upload-label small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
}

.upload-button,
.btn,
.ghost-button,
.filter-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: var(--radius);
  padding: 9px 13px;
  font-weight: 800;
}

.upload-button,
.btn {
  border: 1px solid var(--blue-700);
  color: white;
  background: var(--blue-700);
}

.ghost-button,
.filter-button,
.icon-button {
  border: 1px solid var(--line);
  color: var(--blue-900);
  background: white;
}

.filter-button {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 0.88rem;
}

.filter-button.active,
.ghost-button:hover,
.filter-button:hover,
.icon-button:hover {
  border-color: rgba(36, 114, 208, 0.42);
  color: var(--blue-700);
  background: var(--blue-50);
}

.btn.full {
  width: 100%;
}

.btn.secondary {
  border-color: var(--line);
  color: var(--blue-900);
  background: white;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.file-list {
  display: grid;
  gap: 8px;
}

.file-row {
  justify-content: flex-start;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: white;
}

.file-row span {
  min-width: 0;
  overflow: hidden;
  color: var(--blue-950);
  font-size: 0.9rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row small {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.78rem;
}

.microcopy {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px;
  background: white;
}

.microcopy strong {
  color: var(--blue-950);
}

.microcopy p {
  color: var(--muted);
  font-size: 0.92rem;
}

.empty-state {
  display: grid;
  align-content: center;
  gap: 20px;
  min-height: 560px;
}

.empty-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.empty-card,
.metric-card,
.doc-card,
.note,
.check-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.empty-card,
.metric-card,
.doc-card,
.note {
  padding: 16px;
}

.empty-card strong,
.metric-card strong,
.doc-card strong,
.note strong {
  display: block;
  color: var(--blue-950);
}

.empty-card p,
.doc-card p,
.note p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
}

.metric-card {
  display: grid;
  gap: 6px;
  min-height: 96px;
}

.metric-card em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-card strong {
  font-size: 1.7rem;
  line-height: 1;
}

.metric-card.critical {
  border-color: rgba(199, 54, 54, 0.32);
  background: var(--red-50);
}

.metric-card.warning {
  border-color: rgba(217, 119, 6, 0.34);
  background: var(--orange-50);
}

.metric-card.positive {
  border-color: rgba(25, 135, 84, 0.26);
  background: var(--green-50);
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.doc-card {
  display: grid;
  gap: 8px;
}

.meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill,
.status-badge,
.category-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.pill {
  color: #40516a;
  background: var(--soft);
}

.status-badge.fulfilled {
  color: #0f6b3f;
  background: var(--green-50);
}

.status-badge.missing {
  color: #aa2b2b;
  background: var(--red-50);
}

.status-badge.uncheckable {
  color: #925a00;
  background: var(--orange-50);
}

.category-badge.pflicht {
  color: white;
  background: var(--blue-700);
}

.category-badge.empfehlung {
  color: #0f6b3f;
  background: var(--green-50);
}

.category-badge.unklar {
  color: #925a00;
  background: var(--orange-50);
}

.filter-row {
  flex-wrap: wrap;
  justify-content: flex-start;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.check-card {
  overflow: hidden;
}

.check-card.critical {
  border-color: rgba(199, 54, 54, 0.38);
}

.check-card.warning {
  border-color: rgba(217, 119, 6, 0.4);
}

.check-card.positive {
  border-color: rgba(25, 135, 84, 0.28);
}

.check-main {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.check-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.check-title {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.check-title h3 {
  overflow-wrap: anywhere;
}

.check-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.cell {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px;
  background: var(--soft);
}

.cell.full {
  grid-column: 1 / -1;
}

.cell span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.cell p {
  color: #25344c;
  overflow-wrap: anywhere;
}

.status-line {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.note {
  border-color: rgba(217, 119, 6, 0.35);
  background: var(--orange-50);
}

.error {
  border: 1px solid rgba(199, 54, 54, 0.34);
  border-radius: var(--radius);
  padding: 13px;
  color: #a12828;
  background: var(--red-50);
  font-weight: 750;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.5);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.loading-block {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: white;
}

.bar {
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background: var(--blue-50);
}

.bar span {
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: var(--blue-700);
  animation: load 1.2s ease-in-out infinite alternate;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes load {
  from {
    transform: translateX(-30%);
  }

  to {
    transform: translateX(150%);
  }
}

@media (max-width: 1060px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .input-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  h1 {
    font-size: 2rem;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  .brand {
    width: 100%;
  }

  .brand span {
    white-space: normal;
  }

  .top-actions {
    justify-content: flex-start;
  }

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

  .metric-grid,
  .document-grid,
  .empty-grid,
  .check-grid {
    grid-template-columns: 1fr;
  }

  .result-head,
  .check-top,
  .upload-label {
    align-items: stretch;
    flex-direction: column;
  }
}
