/* 상단 메뉴 (auth.html topbar). 테마 화면·관리 화면 공통이라 색을 여기서 직접 정한다. */
.topbar {
  --tb-bg: #fffaf0;
  --tb-line: #f4dfb3;
  --tb-ink: #4a2e1f;
  --tb-soft: #5e4231;
  --tb-muted: #85674d;
  --tb-hover: #fdf0d2;
  --tb-on: #fde7b0;
  --tb-on-line: #fbc555;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px 18px;
  padding: 8px 16px;
  background: var(--tb-bg); /* 흐림 효과(backdrop-filter)는 글자까지 흐리게 렌더링되는 경우가 있어 단색 */
  border-bottom: 1.5px solid var(--tb-line);
  font-family: system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  color: var(--tb-ink);
  color-scheme: light;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  font-family: 'Jua', 'Malgun Gothic', sans-serif;
  font-size: 1.25rem;
  color: var(--tb-ink);
  text-decoration: none;
}
.topbar-brand img { border-radius: 10px; }

.topbar-tabs { display: flex; gap: 4px; flex: 1; min-width: 0; }
.topbar-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  color: var(--tb-soft);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.topbar-tab:hover { background: var(--tb-hover); color: var(--tb-ink); }
.topbar-tab.on { background: var(--tb-on); border-color: var(--tb-on-line); color: var(--tb-ink); }

/* 아이디 메뉴 (details/summary — 스크립트 없이 열고 닫힘) */
.topbar-user { position: relative; flex: none; }
.topbar-user summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1.5px solid var(--tb-line);
  border-radius: 999px;
  background: #fffdf7;
  color: var(--tb-soft);
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.topbar-user summary::-webkit-details-marker { display: none; }
/* 연결된 마크 계정 얼굴 (없으면 아이디 첫 글자 동그라미) */
.topbar-face { width: 24px; height: 24px; border-radius: 6px; image-rendering: pixelated; }
.topbar-initial {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--tb-on);
  color: var(--tb-ink);
  font-size: .8rem;
  font-weight: 700;
}
.topbar-user summary::after { content: '▾'; font-size: .8em; color: var(--tb-muted); }
.topbar-user[open] summary { background: var(--tb-hover); }
.topbar-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 160px;
  padding: 6px;
  background: #fffdf7;
  border: 1.5px solid var(--tb-line);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(120, 80, 30, .15);
}
.topbar-menu a,
.topbar-menu button {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--tb-ink);
  font: inherit;
  font-size: .92rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.topbar-menu a:hover,
.topbar-menu button:hover { background: var(--tb-hover); }
.topbar-menu form { margin: 0; }

/* 휴대폰: 1줄 = 로고 + 아이디, 2줄 = 탭 (넘치면 옆으로 밀기) */
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; padding: 8px 12px 6px; }
  .topbar-brand { flex: 1; }
  .topbar-tabs {
    order: 3;
    flex-basis: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .topbar-tabs::-webkit-scrollbar { display: none; }
  .topbar-tab { padding: 6px 12px; font-size: .9rem; }
}

/* 진행 중인 경고가 있으면 모니터링 탭 옆 빨간 점 */
.topbar-dot { width: 8px; height: 8px; margin-left: 2px; border-radius: 50%; background: #d64545; box-shadow: 0 0 0 2px var(--tb-bg); }
