:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #1c2430;
  --muted: #647083;
  --line: #dbe3ee;
  --brand: #0d63c9;
  --brand-dark: #084a96;
  --ok: #117a42;
  --ok-bg: #e9f8ef;
  --bad: #b42318;
  --bad-bg: #fff1f0;
  --warn: #996500;
  --warn-bg: #fff7df;
  --shadow: 0 18px 50px rgba(28, 36, 48, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

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

.workspace {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.15;
}

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

.ghost-button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.ghost-button:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.dropzone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 220px;
  margin: 28px;
  padding: 28px;
  border: 2px dashed #9db5d4;
  border-radius: 8px;
  background: #f8fbff;
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: var(--brand);
  background: #eef6ff;
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 32px;
  line-height: 1;
}

.drop-title {
  font-size: 20px;
  font-weight: 700;
}

.drop-copy {
  color: var(--muted);
  line-height: 1.5;
}

.rules-panel {
  margin: 0 28px 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

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

.rule-grid span {
  min-height: 42px;
  padding: 10px 12px;
  border-left: 3px solid var(--brand);
  background: #fff;
  color: #344055;
  font-size: 14px;
  line-height: 1.35;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.summary-strip div {
  padding: 18px 24px;
  border-right: 1px solid var(--line);
}

.summary-strip div:last-child {
  border-right: 0;
}

.summary-strip strong {
  display: block;
  font-size: 28px;
}

.summary-strip span {
  color: var(--muted);
}

.results {
  display: grid;
  gap: 16px;
  padding: 28px;
}

.empty-state {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  text-align: center;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
}

.file-result {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.file-result header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  background: #fbfcfe;
  border-bottom: 1px solid var(--line);
}

.file-name {
  min-width: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.badge.ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.badge.bad {
  background: var(--bad-bg);
  color: var(--bad);
}

.file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 20px;
  color: var(--muted);
  font-size: 14px;
}

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

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

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

th {
  background: #f8fafc;
  color: #344055;
  font-size: 13px;
}

.line-cell {
  width: 94px;
  font-weight: 700;
}

.type-cell {
  width: 190px;
}

.raw-cell {
  max-width: 420px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.all-good {
  padding: 0 20px 20px;
  color: var(--ok);
  font-weight: 700;
}

.bottombar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.bottombar p {
  margin: 0;
  font-weight: 700;
  color: #344055;
}

.bottombar span {
  text-align: right;
}

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

  .topbar,
  .file-result header {
    align-items: flex-start;
    flex-direction: column;
  }

  .dropzone,
  .rules-panel {
    margin-left: 14px;
    margin-right: 14px;
  }

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

  .summary-strip div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .summary-strip div:last-child {
    border-bottom: 0;
  }

  .results {
    padding: 14px;
  }

  .bottombar {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
  }

  .bottombar span {
    text-align: left;
  }
}
