/* Shared header styles. Keep this aligned with the header design on index.php. */
body { padding-top: 0 !important; }
.header a,
.mobile-search-panel a { color: inherit; text-decoration: none; }
.header {
  position: sticky !important;
  top: 0 !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  z-index: 300 !important;
  background: rgba(255,255,255,0.88) !important;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line, #eeeeee) !important;
}
.header-inner {
  position: relative !important;
  max-width: 1100px !important;
  height: 64px !important;
  margin: 0 auto !important;
  padding: 0 24px !important;
  display: flex !important;
  align-items: center;
  gap: 24px;
}
.logo {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem !important;
  font-weight: 600;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}
.logo-mark {
  width: 28px !important;
  height: 28px !important;
  background: var(--text, #000) !important;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
}
.logo-mark::before { content: ''; width: 8px; height: 8px; background: white; border-radius: 50%; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 100px;
  color: var(--muted, #999);
  font-size: .88rem;
  font-weight: 500;
  transition: all .15s;
}
.nav-link:hover, .nav-link.active { color: var(--text, #000); background: var(--hover, #fafafa); }
.nav-link.active { font-weight: 600; }
.nav-link svg { width: 17px; height: 17px; stroke-width: 1.6; }
.actions { display: flex !important; align-items: center; gap: 4px; margin-left: auto; }
.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text, #000);
  transition: background .15s;
}
.icon-btn:hover { background: var(--hover, #fafafa); }
.icon-btn svg { width: 19px; height: 19px; stroke-width: 1.5; }
.icon-btn .badge { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border: 2px solid white; border-radius: 100px; background: var(--text, #000); color: white; font-size: .6rem; font-weight: 700; display: grid; place-items: center; }
.account { position: relative !important; display: block !important; width: auto !important; height: auto !important; background: transparent !important; cursor: default; }
.account-btn { display: flex !important; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 100px; transition: background .15s; }
.account-btn:hover, .account-btn.open { background: var(--hover, #fafafa); }
.account-avatar { width: 32px !important; height: 32px !important; border-radius: 50%; background: var(--text, #000); color: white; display: grid; place-items: center; overflow: hidden; font-size: .78rem; font-weight: 500; flex-shrink: 0; }
.account-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.account-name { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; font-weight: 500; }
.account-btn .chevron { width: 14px; height: 14px; color: var(--muted, #999); transition: transform .2s; }
.account-btn.open .chevron { transform: rotate(180deg); }
.dropdown { top: calc(100% + 8px); right: 0; width: 280px; padding: 6px; background: var(--bg-soft, #fff); border: 1px solid var(--line, #eee); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.08); }
.dropdown-user { padding: 14px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line, #eee); margin-bottom: 6px; }
.dropdown-user .account-avatar { width: 42px !important; height: 42px !important; }
.dropdown-user-info { flex: 1; min-width: 0; }
.dropdown-user-name { font-weight: 600; font-size: .92rem; }
.dropdown-user-handle { color: var(--muted, #999); font-size: .8rem; }
.dropdown-item { display: flex; align-items: center; width: 100%; padding: 10px 12px; border-radius: 8px; color: var(--text, #000); font-size: .9rem; text-align: left; }
.dropdown-item:hover { background: var(--hover, #fafafa); }
.dropdown-item.danger { color: #dc2626; }
.dropdown-sep { height: 1px; margin: 6px 0; background: var(--line, #eee); }
.header-search { width: 220px; height: 38px; }
@media (max-width: 640px) {
  .header-inner { padding: 0 16px !important; gap: 12px; }
  .header-search { width: 38px; padding: 0; justify-content: center; border: 0; background: transparent; }
  .header-search input { display: none; }
  .account-name { display: none; }
  .account-btn { padding: 4px; }
}
@media (max-width: 500px) {
  .header-inner { padding: 0 12px !important; gap: 8px; }
  .site-logo { width: 28px; height: 28px; }
  .brand-name { font-size: 1.12rem; }
  .account-avatar { width: 30px !important; height: 30px !important; }
  .dropdown { right: -4px; width: min(260px, calc(100vw - 24px)); }
}