.analyzer-page {
  background: #f5f7f6;
  color: #17201d;
}

.analyzer-main {
  max-width: 1240px;
}

.analyzer-workbench {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.report-drop-zone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 142px;
  padding: 24px;
  border: 1px dashed #879c94;
  border-radius: 6px;
  background: #f8fbfa;
  text-align: center;
  transition: border-color 120ms ease, background 120ms ease;
}

.report-drop-zone.dragging {
  border-color: #087e71;
  background: #e8f6f2;
}

.report-drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.report-drop-zone label {
  display: grid;
  gap: 4px;
  cursor: pointer;
}

.report-drop-zone label strong {
  color: #087e71;
  font-size: 1rem;
}

.report-drop-zone label span,
.report-drop-zone p,
.input-boundary,
.source-table-note {
  color: #66736e;
  font-size: 0.82rem;
}

.report-drop-zone p {
  margin: 12px 0 0;
}

.input-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: #73807b;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.input-divider::before,
.input-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #d9e0dd;
}

.report-xml-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.82rem;
  font-weight: 700;
}

#report-xml {
  box-sizing: border-box;
  width: 100%;
  min-height: 238px;
  resize: vertical;
  padding: 14px;
  border: 1px solid #c8d1cd;
  border-radius: 5px;
  background: #fff;
  color: #17201d;
  font: 0.78rem/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0;
}

#report-xml:focus {
  border-color: #087e71;
  outline: 2px solid rgba(8, 126, 113, 0.18);
  outline-offset: 1px;
}

.input-boundary {
  margin: 10px 0 0;
  line-height: 1.55;
}

.analyzer-actions {
  flex-wrap: wrap;
}

.analyzer-output .output-heading {
  align-items: flex-start;
}

.analyzer-output .status-chip {
  display: inline-flex;
  white-space: nowrap;
}

.analyzer-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid #dbe2df;
  border-radius: 6px;
  background: #dbe2df;
}

.analyzer-metrics > div {
  min-width: 0;
  padding: 14px;
  background: #fff;
}

.analyzer-metrics span {
  display: block;
  min-height: 32px;
  color: #68756f;
  font-size: 0.72rem;
  line-height: 1.35;
}

.analyzer-metrics strong {
  display: block;
  margin-top: 8px;
  color: #17201d;
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.analysis-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  margin: 20px 0;
}

.analysis-facts div {
  min-width: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e7e5;
}

.analysis-facts dt {
  color: #6b7772;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.analysis-facts dd {
  margin: 6px 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.analysis-section h3 {
  margin: 0 0 10px;
  font-size: 0.9rem;
}

.policy-list,
.analysis-warnings {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.policy-list li,
.analysis-warnings li {
  padding: 10px 12px;
  border-left: 3px solid #2b8f83;
  background: #eff7f5;
  font-size: 0.82rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.analysis-warnings {
  margin-top: 16px;
}

.analysis-warnings li {
  border-left-color: #c47a23;
  background: #fff7ea;
}

.analyzer-result-actions {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.source-section {
  margin-top: 28px;
  padding: 24px;
  border: 1px solid #d7dfdc;
  border-radius: 6px;
  background: #fff;
}

.source-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.source-heading h2 {
  margin: 4px 0 0;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.source-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.source-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, auto));
  padding: 3px;
  border: 1px solid #cbd5d1;
  border-radius: 6px;
  background: #f5f7f6;
}

.source-filter button,
.export-action {
  min-height: 34px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #37433e;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.source-filter button {
  padding: 0 12px;
}

.source-filter button[aria-pressed="true"] {
  background: #fff;
  color: #087e71;
  box-shadow: 0 1px 3px rgba(27, 45, 39, 0.13);
}

.export-action {
  padding: 0 14px;
  border: 1px solid #087e71;
  color: #087e71;
}

.source-table-wrap {
  overflow-x: auto;
  border: 1px solid #dbe2df;
  border-radius: 5px;
}

.source-table-wrap table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.source-table-wrap th,
.source-table-wrap td {
  padding: 11px 12px;
  border-bottom: 1px solid #e3e8e6;
  text-align: left;
  vertical-align: top;
}

.source-table-wrap thead th {
  background: #f3f6f5;
  color: #596660;
  font-size: 0.68rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.source-table-wrap tbody th {
  color: #17201d;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.source-table-wrap tbody tr:last-child th,
.source-table-wrap tbody tr:last-child td {
  border-bottom: 0;
}

.source-empty,
.source-table-note {
  margin: 12px 0 0;
}

.analyzer-reference {
  margin-top: 28px;
}

.analyzer-reference-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .analyzer-workbench {
    grid-template-columns: minmax(0, 1fr);
  }

  .source-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .analyzer-reference-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .analyzer-metrics,
  .analysis-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .source-section {
    padding: 18px 14px;
  }

  .source-controls {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

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

  .export-action {
    min-height: 40px;
  }
}
