/* UN 번호 조회. 페이지 틀(.at-main, .at-hero, .at-search, .at-fold)은 airtracking.css를 같이 쓴다. */
.un-role {
  display: grid;
  gap: 6px;
  margin-top: 18px;
  padding: 14px 16px;
  border-left: 4px solid #e0a100;
  border-radius: 10px;
  background: #fff8e6;
  color: #5c4300;
  font-size: 14px;
  line-height: 1.65;
}
.un-role p { margin: 0; }

/* 목록: 넓은 화면은 표처럼, 좁은 화면은 카드 */
.un-list {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  overflow: hidden;
}
.un-head,
.un-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 84px 128px 72px 104px 22px;
  gap: 12px;
  align-items: center;
  padding: 11px 16px;
}
.un-head {
  background: #eef4fb;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}
.un-item + .un-item,
#unBody > .un-item:first-child {
  border-top: 1px solid #e6edf4;
}
.un-row {
  width: 100%;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.un-row:hover { background: #f6f9fd; }
.un-row:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}
.un-item.is-open > .un-row { background: #f1f6fc; }
.un-row i {
  display: none;
  font-style: normal;
}
.un-no {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.un-name {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.un-ko {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.45;
}
.un-en {
  color: var(--body);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.un-name mark {
  padding: 0 1px;
  border-radius: 3px;
  background: #fff1a8;
  color: inherit;
}
.un-same {
  justify-self: start;
  margin-top: 2px;
  padding: 0 7px;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}
.un-cls,
.un-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.un-pg,
.un-ems {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.un-none { color: #a8b5c2; font-weight: 400; }
.un-subnote {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.un-chev {
  justify-self: end;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s;
}
.un-item.is-open .un-chev { transform: rotate(-135deg); }
.un-mp,
.un-warn {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
}
.un-mp { background: #e3f4ea; color: #1d6b3b; }
.un-warn {
  margin-left: 4px;
  background: #fdecec;
  color: #a3261f;
  vertical-align: 1px;
}

/* 급 배지: 표찰 그림이 아니라 급을 구분하는 색만 쓴다 */
.un-badge {
  display: inline-block;
  min-width: 34px;
  padding: 2px 7px;
  border: 1.5px solid transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
}
.un-badge.is-sub {
  min-width: 28px;
  padding: 1px 5px;
  font-size: 12px;
}
.un-badge.c1 { background: #f59a23; color: #2b1600; }
.un-badge.c2-1 { background: #d7261e; color: #fff; }
.un-badge.c2-2 { background: #1f8a4c; color: #fff; }
.un-badge.c2-3 { background: #fff; border-color: #1b1b1b; color: #1b1b1b; }
.un-badge.c2 { background: #e9eef3; border-color: #8a99a8; color: #2c3a48; }
.un-badge.c3 { background: #d7261e; color: #fff; }
.un-badge.c4-1 { background: #fff; border-color: #d7261e; color: #b51d16; }
.un-badge.c4-2 { background: linear-gradient(#fff 50%, #d7261e 50%); border-color: #d7261e; color: #1b1b1b; text-shadow: 0 0 2px #fff, 0 0 2px #fff; }
.un-badge.c4-3 { background: #1d5fbf; color: #fff; }
.un-badge.c5-1 { background: #ffd400; color: #1b1b1b; }
.un-badge.c5-2 { background: linear-gradient(#d7261e 50%, #ffd400 50%); color: #1b1b1b; text-shadow: 0 0 2px #fff, 0 0 2px #fff; }
.un-badge.c6-1 { background: #fff; border-color: #1b1b1b; color: #1b1b1b; }
.un-badge.c6-2 { background: #fff; border-color: #6b7a89; color: #3b4a59; }
.un-badge.c7 { background: linear-gradient(#ffd400 50%, #fff 50%); border-color: #c9a800; color: #1b1b1b; }
.un-badge.c8 { background: #1b1b1b; color: #fff; }
.un-badge.c9 { background: #eef0f3; border-color: #1b1b1b; color: #1b1b1b; }

/* 펼친 칸 */
.un-detail {
  padding: 4px 16px 18px;
  background: #f9fbfe;
  border-top: 1px dashed #dbe5ef;
}
.un-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
  margin: 0;
}
.un-f {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #e9eff5;
}
.un-f dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.un-f dd {
  align-content: start;
  display: grid;
  gap: 3px;
  min-width: 0;
  margin: 0;
}
.un-v {
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.un-v .un-badge { margin-right: 4px; }
.un-f small {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}
.un-extra {
  color: var(--body);
  font-weight: 500;
  font-size: 13px;
}
.un-props {
  grid-column: 1 / -1;
}
.un-props dd {
  color: var(--body);
  font-size: 14px;
  line-height: 1.65;
}
.un-x {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fdecec;
  color: #8a1f19;
  font-size: 13.5px;
  line-height: 1.6;
}

.un-empty {
  margin: 14px 0 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fff6e0;
  color: #6b4a00;
  line-height: 1.65;
}
.un-more {
  margin-top: 14px;
  text-align: center;
}
.un-more button {
  padding: 10px 22px;
  border: 1px solid #b9cbe0;
  border-radius: 10px;
  background: #fff;
  color: var(--blue-deep);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.un-more button:hover { border-color: var(--blue); }

.un-fold-lead,
.un-source {
  margin: 16px 20px;
  color: var(--body);
  font-size: 14.5px;
  line-height: 1.75;
}
.un-source p { margin: 0 0 12px; }
.un-source a,
.un-fold-lead a { color: var(--blue-deep); font-weight: 700; overflow-wrap: anywhere; }
.un-bam {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f3f7fb;
  font-size: 13px;
}
.at-fold > .un-fold-lead + .at-table-wrap { margin-top: 0; }
.un-guide { min-width: 0; }
.un-guide td:first-child { white-space: nowrap; }
.un-guide td:nth-child(2) { white-space: nowrap; color: var(--muted); }

@media (max-width: 900px) {
  .un-head,
  .un-row { grid-template-columns: 84px minmax(0, 1fr) 72px 108px 64px 92px 18px; gap: 10px; }
  .un-fields { grid-template-columns: 1fr; }
}

/* 좁은 화면: 카드 */
@media (max-width: 720px) {
  .un-head { display: none; }
  .un-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    padding: 14px;
  }
  .un-no { order: 1; font-size: 16px; }
  .un-cls { order: 2; }
  .un-chev { order: 3; margin-left: auto; margin-right: 4px; }
  .un-name { order: 4; flex-basis: 100%; }
  .un-sub { order: 5; }
  .un-pg { order: 6; }
  .un-ems { order: 7; }
  .un-sub,
  .un-pg,
  .un-ems { font-size: 13px; }
  .un-row i {
    display: inline;
    margin-right: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }
  .un-cls i { display: none; }
  .un-f { grid-template-columns: 96px minmax(0, 1fr); gap: 8px; }
  .un-detail { padding: 2px 14px 16px; }
  .un-fold-lead,
  .un-source { margin: 14px 16px; font-size: 14px; }
  .un-guide { min-width: 520px; }
}

.un-main .at-source a { color: var(--blue-deep); font-weight: 700; }
@media (max-width: 560px) {
  .un-main .at-lead { margin-bottom: 18px; font-size: 14.5px; }
  .un-role { margin-top: 14px; padding: 12px 13px; font-size: 13px; }
}


/* 100행씩 페이지 이동 */
.un-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: 18px 0 4px; }
.un-pager button { font: inherit; font-size: 14px; min-width: 38px; padding: 6px 10px; border: 1px solid #c9d6e6; border-radius: 8px; background: #fff; color: #10243e; cursor: pointer; font-variant-numeric: tabular-nums; }
.un-pager button:hover:not(:disabled) { background: #eef4fb; }
.un-pager button[aria-current="page"] { background: #1f5fae; border-color: #1f5fae; color: #fff; font-weight: 700; }
.un-pager button:disabled { opacity: .4; cursor: default; }
.un-pager .un-gap { color: #5f6b7a; padding: 0 2px; }
.un-pager .un-pos { width: 100%; text-align: center; font-size: 12.5px; color: #5f6b7a; }

/* BAM 출처 표시(라이선스 조건): 차이 안내 상자 안에 작게 */
.un-x .un-bam { display: block; margin-top: 6px; font-size: 11.5px; color: #5f6b7a; overflow-wrap: anywhere; }
/* 표 위 범례 */
.un-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.un-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.un-legend .un-warn { margin-left: 0; }
.un-badge-ex { display: inline-block; padding: 1px 8px; border-radius: 6px; background: linear-gradient(90deg, #d4281d 0 33%, #f59e0b 33% 66%, #1f5fae 66%); color: #fff; font-size: 11px; font-weight: 800; }
/* 목록 머리는 스크롤해도 위에 붙어 있다 */
#unScroll .un-head { position: sticky; top: 0; z-index: 1; }

/* 위쪽 여백 축소 */
.un-role { margin-top: 14px; padding: 10px 14px; font-size: 13.5px; }
.un-legend { margin-bottom: 8px; }

/* 목록이 그려지기 전에도 자리를 잡아 두어 푸터가 밀려 내려가지 않게 한다(화면 밀림 방지) */
#unBody:empty { min-height: 100vh; }
