@page {
  size: landscape;
  margin: 0.3in;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #fff;
  color: #000;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.print-root {
  padding: 8px;
  background: #fff;
}

.print-container {
  max-width: 1800px;
  margin: 0 auto;
}

.print-header {
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

h1 {
  margin: 0;
  color: #000;
  font-size: 18px;
  line-height: 28px;
  font-weight: 700;
}

.subtitle {
  margin: 0;
  color: #4b5563;
  font-size: 12px;
  line-height: 16px;
}

.print-action {
  padding: 6px 10px;
  border: 1px solid #000;
  border-radius: 6px;
  background: #000;
  color: #fff;
  font: 700 12px/1 ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
}

.legend {
  margin-bottom: 8px;
  padding: 8px;
  background: #f9fafb;
  border: 1px solid #000;
  border-radius: 4px;
}

.legend-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.info-icon {
  width: 12px;
  height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #000;
  border-radius: 999px;
  color: #000;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
}

.legend h2 {
  margin: 0;
  color: #000;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}

.legend-section {
  margin-bottom: 8px;
}

.legend h3 {
  margin: 0 0 4px;
  color: #374151;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.level-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.level-box,
.rating-box {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-weight: 700;
  line-height: 1;
}

.level-box {
  width: 24px;
  height: 24px;
  font-size: 12px;
}

.level-label {
  color: #374151;
  font-size: 14px;
  line-height: 20px;
}

.level-3 {
  background: #000;
  color: #fff;
}

.level-2 {
  background: #9ca3af;
  color: #fff;
}

.level-1 {
  background: #d1d5db;
  color: #000;
}

.level-0 {
  background: #fff;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}

.roles-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #d1d5db;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 12px;
  row-gap: 2px;
}

.role-item {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.role-id {
  min-width: 20px;
  color: #000;
  font-size: 14px;
  line-height: 20px;
  font-weight: 700;
}

.role-name {
  color: #374151;
  font-size: 14px;
  line-height: 20px;
}

.matrix {
  background: #fff;
  border: 1px solid #000;
}

.table-wrap {
  overflow: visible;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

thead tr {
  background: #000;
  color: #fff;
}

th.skill-head {
  width: 280px;
  padding: 4px;
  text-align: left;
  border: 1px solid #4b5563;
  background: #000;
  font-weight: 600;
}

th.role-head {
  width: 40px;
  padding: 4px;
  text-align: center;
  border: 1px solid #4b5563;
  background: #000;
  font-weight: 700;
}

.cat-row {
  background: #f9fafb;
  border-bottom: 2px solid #000;
}

.cat-cell {
  padding: 4px;
  color: #000;
  border: 1px solid #d1d5db;
  font-weight: 700;
}

.skill-row {
  border-bottom: 1px solid #e5e7eb;
}

.skill-cell {
  padding: 4px;
  color: #374151;
  border-right: 1px solid #e5e7eb;
}

.rating-cell {
  padding: 0;
  text-align: center;
  border-left: 1px solid #e5e7eb;
}

.rating-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 4px;
}

.rating-box {
  width: 20px;
  height: 20px;
  font-size: 9px;
}

.footer {
  margin-top: 4px;
  text-align: center;
  color: #4b5563;
  font-size: 8px;
  line-height: 1.2;
}

@media print {
  body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .no-print {
    display: none !important;
  }
}
