* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

table {
  border-spacing: 0;
}

.container {
  width: 100%;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.max-w-4xl {
  max-width: 56rem;
}

.p-6 {
  padding: 1.5rem;
}

.p-4 {
  padding: 1rem;
}

.p-3 {
  padding: 0.75rem;
}

.p-2 {
  padding: 0.5rem;
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.px-3 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.py-1 {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.mt-8 {
  margin-top: 2rem;
}

.mt-4 {
  margin-top: 1rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mb-3 {
  margin-bottom: 0.75rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-1 {
  margin-bottom: 0.25rem;
}

.mr-2 {
  margin-right: 0.5rem;
}

.space-y-6>*+* {
  margin-top: 1.5rem;
}

.space-y-4>*+* {
  margin-top: 1rem;
}

.space-y-2>*+* {
  margin-top: 0.5rem;
}

.block {
  display: block;
}

.flex {
  display: flex;
}

.grid {
  display: grid;
}

.hidden {
  display: none;
}

.items-center {
  align-items: center;
}

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

.gap-4 {
  gap: 1rem;
}

.w-full {
  width: 100%;
}

.min-w-full {
  min-width: 100%;
}

.h-4 {
  height: 1rem;
}

.w-4 {
  width: 1rem;
}

.max-h-40 {
  max-height: 10rem;
}

.overflow-x-auto {
  overflow-x: auto;
}

.overflow-y-auto {
  overflow-y: auto;
}

.border {
  border: 1px solid #d1d5db;
}

.border-collapse {
  border-collapse: collapse;
}

.border-gray-300 {
  border-color: #d1d5db;
}

.border-blue-200 {
  border-color: #bfdbfe;
}

.border-b-2 {
  border-bottom-width: 2px;
}

.border-blue-600 {
  border-color: #2563eb;
}

.rounded {
  border-radius: 0.25rem;
}

.rounded-full {
  border-radius: 9999px;
}

.shadow {
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.12), 0 1px 2px rgb(0 0 0 / 0.08);
}

.shadow-inner {
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 0.06);
}

.bg-gray-100 {
  background-color: #f3f4f6;
}

.bg-gray-200 {
  background-color: #e5e7eb;
}

.bg-gray-300 {
  background-color: #d1d5db;
}

.bg-white {
  background-color: #ffffff;
}

.bg-blue-50 {
  background-color: #eff6ff;
}

.bg-blue-600 {
  background-color: #2563eb;
}

.bg-green-600 {
  background-color: #16a34a;
}

.bg-red-500 {
  background-color: #ef4444;
}

.bg-yellow-50 {
  background-color: #fefce8;
}

.hover\:bg-blue-700:hover {
  background-color: #1d4ed8;
}

.hover\:bg-green-700:hover {
  background-color: #15803d;
}

.hover\:bg-red-600:hover {
  background-color: #dc2626;
}

.hover\:bg-gray-300:hover {
  background-color: #d1d5db;
}

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

.text-center {
  text-align: center;
}

.text-3xl {
  font-size: 1.875rem;
  line-height: 2.25rem;
}

.text-lg {
  font-size: 1.125rem;
  line-height: 1.75rem;
}

.text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.text-xs {
  font-size: 0.75rem;
  line-height: 1rem;
}

.font-bold {
  font-weight: 700;
}

.font-semibold {
  font-weight: 600;
}

.font-medium {
  font-weight: 500;
}

.text-white {
  color: #ffffff;
}

.text-gray-900 {
  color: #111827;
}

.text-gray-600 {
  color: #4b5563;
}

.text-gray-500 {
  color: #6b7280;
}

.text-blue-800 {
  color: #1e40af;
}

.text-blue-600 {
  color: #2563eb;
}

.text-green-600 {
  color: #16a34a;
}

.text-red-600 {
  color: #dc2626;
}

.text-yellow-700 {
  color: #a16207;
}

.whitespace-pre-wrap {
  white-space: pre-wrap;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

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

@media (min-width: 768px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .md\:w-auto {
    width: auto;
  }
}

/* NEW STYLES */

.tab-bar {
  display: flex;
  border-bottom: 2px solid #d1d5db;
  gap: 0;
}

.tab-btn {
  padding: 0.5rem 1.5rem;
  font-weight: 600;
  color: #6b7280;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover {
  color: #111827;
}

.tab-btn-active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.tab-content {
  /* hidden class handles visibility */
}

.contradiction-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.contradiction-header .header-col {
  flex: 1;
  min-width: 0;
}

.contradiction-header .arrow-placeholder,
.contradiction-row .arrow {
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}

.contradiction-header .btn-placeholder,
.contradiction-row .row-btn-group {
  width: 4.5rem;
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.contradiction-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contradiction-row select {
  flex: 1;
  min-width: 0;
}

.contradiction-row .arrow {
  color: #6b7280;
  font-weight: 600;
}

.btn-add-row {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  border: 1px solid #d1d5db;
  background: #ecfdf5;
  color: #16a34a;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
}

.btn-add-row:hover {
  background: #dcfce7;
}

.btn-remove-row {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  border: 1px solid #d1d5db;
  background: #fef2f2;
  color: #dc2626;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
}

.btn-remove-row:hover {
  background: #fee2e2;
}

.policy-cards {
  display: flex;
  gap: 1rem;
}

.policy-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  border: 2px solid #d1d5db;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.policy-card:hover {
  border-color: #93c5fd;
}

.policy-card-selected {
  border-color: #2563eb;
  background-color: #eff6ff;
}

.policy-radio {
  display: none;
}

.policy-card-title {
  font-weight: 600;
  font-size: 0.875rem;
}

.policy-card-desc {
  font-size: 0.75rem;
  color: #6b7280;
}

.badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-ready {
  background-color: #dcfce7;
  color: #166534;
}

.badge-incomplete {
  background-color: #fef3c7;
  color: #92400e;
}

.badge-blocked {
  background-color: #fef2f2;
  color: #991b1b;
}

.badge-missing {
  background-color: #fef3c7;
  color: #92400e;
}

.validation-ready {
  border-color: #86efac;
  background-color: #f0fdf4;
  color: #166534;
}

.validation-blocked {
  border-color: #fca5a5;
  background-color: #fef2f2;
  color: #991b1b;
}

.validation-incomplete {
  border-color: #fcd34d;
  background-color: #fffbeb;
  color: #92400e;
}

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