/* ============ 세로 네비게이션 바 ============ */
/*
   position: fixed 로 띄우고 body 에 왼쪽 여백만 준다.
   기존 .container(max-width 900px, 가운데 정렬)를 감싸지 않는 게 핵심 —
   감싸면 지금 홈 화면 레이아웃이 통째로 흔들린다.
*/
.nav-rail {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 56px;
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 0;
  z-index: 50;
}

.nav-item {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  transition: background 0.12s, border-color 0.12s;
  position: relative;
  /* 아이콘이 흐리게 보이지 않도록 */
  opacity: 0.55;
}
.nav-item:hover {
  background: var(--bg-hover);
  opacity: 1;
}
.nav-item.active {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  opacity: 1;
}
/* 어느 탭인지 왼쪽 표시선 */
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 1px;
  background: var(--accent);
}
.nav-item:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

/* 호버하면 이름이 뜬다. 아이콘만으로는 무슨 탭인지 알기 어렵다. */
.nav-item::after {
  content: attr(data-label);
  position: absolute;
  left: 48px;
  white-space: nowrap;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: var(--radius);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-4px);
  transition: opacity 0.12s, transform 0.12s;
  z-index: 60;
}
.nav-item:hover::after,
.nav-item:focus-visible::after {
  opacity: 1;
  transform: translateX(0);
}

.nav-spacer { flex: 1; }

/* 본문을 바 오른쪽으로 밀어낸다 */
body { padding-left: 72px; }

/* 뷰 전환 */
.view[hidden] { display: none; }

/* ---- 좁은 화면: 아래 가로 바로 ---- */
/*
   세로 바가 좁은 화면에서 본문을 너무 잡아먹는다.
   창을 반으로 놓고 쓸 때를 위한 것.
*/
@media (max-width: 900px) {
  .nav-rail {
    top: auto;
    right: 0;
    bottom: 0;
    width: auto;
    height: 52px;
    flex-direction: row;
    justify-content: space-around;
    border-right: none;
    border-top: 1px solid var(--border);
    padding: 0 8px;
  }
  .nav-item.active::before {
    left: 8px;
    right: 8px;
    top: -4px;
    bottom: auto;
    width: auto;
    height: 2px;
  }
  /* 아래 바에서는 툴팁을 위로 띄운다 */
  .nav-item::after {
    left: 50%;
    bottom: 46px;
    transform: translate(-50%, 4px);
  }
  .nav-item:hover::after,
  .nav-item:focus-visible::after {
    transform: translate(-50%, 0);
  }
  .nav-spacer { display: none; }
  body {
    padding-left: 16px;
    /* 하단 바에 가리지 않게 */
    padding-bottom: 76px;
  }
}

/* ---- 새 탭들의 기본 뼈대 ---- */
.view-header {
  margin-bottom: 20px;
}
.view-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
}
.view-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.view-empty {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  color: var(--text-secondary);
  font-size: 13px;
}
