/* 원본 상단의 같은 노드와 동적 세션 버튼을 행 단위로 배치한다.
 * 로그인/종료의 hidden·inert와 메뉴/프로젝트 선택은 기존 JS가 계속 관리한다. */
.app > .main > .topbar {
  --topbar-action-height: 40px;
  --topbar-action-font-size: 12px;
  --topbar-action-padding: 9px 12px;
  height: auto;
  min-height: 80px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 15px 30px;
  background: var(--surface, #fff);
  border-bottom: 1px solid var(--line, #e8ebf0);
}
.app > .main > .topbar .breadcrumbs {
  flex: 0 1 auto;
  min-width: 0;
  gap: 10px;
  color: #7b8799;
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
}
.app > .main > .topbar .breadcrumbs b {
  min-width: 0;
  max-width: 32ch;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #46536a;
  font-weight: 600;
}
.app > .main > .topbar .top-actions {
  flex: 1 1 640px;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.app > .main > .topbar .top-actions > button,
.app > .main > .topbar #currentUser {
  flex-shrink: 0;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid #dce1eb;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  box-shadow: 0 1px 2px #182c4905;
}
.app > .main > .topbar .top-actions > button:not(:disabled):hover { background: #f6f5fc; border-color: #c9c1ef; }
.app > .main > .topbar .top-actions > button:disabled { cursor: not-allowed; color: #8994a5; background: #f5f6f9; border-color: #e5e8ef; box-shadow: none; }
.app > .main > .topbar #unifiedSearchButton:not(:disabled),
.app > .main > .topbar #keywordRagChatButton:not(:disabled) { color: #6552bf; background: #f7f5ff; border-color: #e2dcf7; }
.app > .main > .topbar #currentUser { min-width: 100px; max-width: 170px; padding-right: 24px; overflow: hidden; text-overflow: ellipsis; }
.app > .main > .topbar #javaLogout { background: #f8f9fc; }
/* 세션·챗봇 CSS는 로그인 뒤 적재된다. 그 버튼의 별도 크기보다 공통 높이를
 * 우선하되 기능별 색상·숨김·잠금과 실제 이벤트는 기존 모듈에 맡긴다. */
.app > .main > .topbar .top-actions > :is(#unifiedSearchButton, #keywordRagChatButton, #mobileMemberAdmin, #javaPasswordChange, #javaLogout) {
  min-height: var(--topbar-action-height);
  padding: var(--topbar-action-padding);
  font-size: var(--topbar-action-font-size);
  line-height: 1.5;
}
.app > .main > .topbar .search {
  flex: 1 1 180px;
  min-width: 120px;
  max-width: 300px;
  min-height: 40px;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid #dce1eb;
  border-radius: 8px;
  background: #f8f9fc;
  color: #8792a5;
}
.app > .main > .topbar .search input { flex: 1 1 0; width: 100%; min-width: 0; min-height: 38px; padding: 0; font-size: 12px; color: #334155; }
.app > .main > .topbar .search kbd { flex-shrink: 0; font-size: 10px; background: #fff; border-color: #e2e6ee; border-radius: 4px; }
.app > .main > .topbar .search:focus-within { border-color: #a99ae7; outline: 2px solid #d4ccfa; outline-offset: 1px; }
.app > .main > .topbar button:focus-visible,
.app > .main > .topbar select:focus-visible { outline: 3px solid #bcb4f3; outline-offset: 2px; }
.app > .main > .topbar > .sidebar-hamburger { flex-shrink: 0; width: 40px; min-height: 40px; margin: 0; padding: 5px; border: 1px solid var(--line, #e8ebf0); border-radius: 8px; background: #fff; color: #5c647b; }
/* 업무 보기 조작도 같은 높이로 맞추되 기존 내부 가로 스크롤·활성 탭을 보존한다. */
.app .content > .toolbar { flex-wrap: wrap; gap: 12px; align-items: center; }
.app .content > .toolbar > .tabs { flex: 1 1 460px; min-width: 0; max-width: 100%; gap: 3px; padding: 4px; border: 1px solid #e8e9f1; border-radius: 9px; background: #eef0f6; scrollbar-width: thin; }
.app .content > .toolbar .tabs > button { flex-shrink: 0; min-height: 36px; padding: 8px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.app .content > .toolbar .tabs > button.active { color: #6351bd; background: #fff; box-shadow: 0 1px 4px #33415510; }
.app .content > .toolbar .filters { flex-wrap: wrap; gap: 8px; }
.app .content > .toolbar .filters select { min-height: 38px; padding: 8px 11px; border: 1px solid #dce1eb; border-radius: 7px; background: #fff; color: #566277; font-size: 12px; }
/* PC에서는 문구 길이와 무관하게 네 동작의 폭을 맞춘다. 모바일은 기존
 * 검색 2분할·계정 3분할을 그대로 쓰고 입력창·회원 선택의 폭은 분리한다. */
@media (min-width: 721px) {
  .app > .main > .topbar .top-actions > :is(#unifiedSearchButton, #keywordRagChatButton, #javaPasswordChange, #javaLogout) {
    flex: 0 0 96px;
    width: 96px;
    min-width: 96px;
    max-width: 96px;
    padding-inline: 8px;
  }
}
@media (min-width: 721px) and (max-width: 1440px) {
  .app > .main > .topbar .breadcrumbs { flex-basis: 100%; }
  .sidebar-hidden .app > .main > .topbar .breadcrumbs { flex-basis: auto; }
  .app > .main > .topbar .top-actions { flex-basis: 100%; }
}
@media (max-width: 720px) {
  .app > .main > .topbar { --topbar-action-height: 44px; --topbar-action-font-size: 11px; --topbar-action-padding: 9px 7px; min-height: 60px; justify-content: flex-start; gap: 10px; padding: 12px 16px; }
  .app > .main > .topbar .breadcrumbs { display: none; }
  .app > .main > .topbar > .sidebar-hamburger { width: 44px; min-height: 44px; }
  .app > .main > .topbar .mobile-brand { font-size: 21px; letter-spacing: -.5px; }
  .app > .main > .topbar .top-actions { flex: 1 0 100%; width: 100%; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
  .app > .main > .topbar .top-actions > button,
  .app > .main > .topbar #currentUser { min-width: 0; min-height: 44px; max-width: 100%; width: 100%; padding: 9px 7px; font-size: 11px; }
  .app > .main > .topbar .search { grid-column: 1 / -1; grid-row: 1; min-width: 0; max-width: 100%; min-height: 44px; }
  .app > .main > .topbar .search input { min-height: 42px; }
  .app > .main > .topbar #unifiedSearchButton { grid-column: 1 / 4; }
  .app > .main > .topbar #keywordRagChatButton { grid-column: 4 / 7; }
  .app > .main > .topbar #currentUser { grid-column: 1 / 3; padding-right: 18px; }
  .app > .main > .topbar #javaPasswordChange { grid-column: 3 / 5; }
  .app > .main > .topbar #javaLogout { grid-column: 5 / 7; }
  .app > .main > .topbar #mobileMemberAdmin { grid-column: 1 / -1; }
  .app .content > .toolbar > .tabs { flex-basis: 100%; }
  .app .content > .toolbar .tabs > button,
  .app .content > .toolbar .filters select { min-height: 44px; }
}
