/* ============================================================
   ZZAN Top Bar — 공용 글로벌 상단바 (자기완결 / 테마 대응)
   prefix: zt-  ·  다른 모듈에 폴더째 복사해 사용
   ============================================================ */
#zzan_topbar {
    --zt-h: 54px;
    --zt-bg: #ffffff;
    --zt-fg: #15231d;
    --zt-fg-soft: #5a6b63;
    --zt-border: rgba(16, 60, 45, 0.10);
    --zt-surface: color-mix(in srgb, #0066ff 8%, #ffffff);  /* 롤오버: 포인트(블루) 틴트 */
    --zt-accent: #0066ff;
    --zt-accent-deep: #0052cc;
    --zt-shadow: 0 8px 30px rgba(16, 60, 45, 0.12);
    --zt-radius: 14px;
    position: sticky; top: 0; z-index: 1000;
    font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}
[data-theme="dark"] #zzan_topbar {
    --zt-bg: #1e2024;
    --zt-fg: #f0f1f3;
    --zt-fg-soft: #a8acb3;
    --zt-border: rgba(255, 255, 255, 0.10);
    --zt-surface: color-mix(in srgb, #0066ff 22%, #23262b);  /* 다크 롤오버: 블루 섞인 짙은 회색 */
    --zt-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
}
#zzan_topbar * { box-sizing: border-box; }
#zzan_topbar a { text-decoration: none; color: inherit; }
#zzan_topbar button { font-family: inherit; cursor: pointer; border: none; background: none; }

.zt__inner {
    height: var(--zt-h);
    max-width: 1280px; margin: 0 auto; padding: 0 18px;
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px;
    background: var(--zt-bg); color: var(--zt-fg);
}
#zzan_topbar { background: var(--zt-bg); border-bottom: 1px solid var(--zt-border); }

/* 좌(전체서비스/버거) · 중앙(로고) · 우(인증) */
.zt__left { justify-self: start; display: flex; align-items: center; gap: 8px; min-width: 0; }
.zt__auth { justify-self: end; }

/* 로고 (중앙 정렬) */
.zt__logo { justify-self: center; display: flex; align-items: center; gap: 9px; }
.zt__logo img { height: 28px; width: auto; display: block; border-radius: 7px; }
.zt__logo-text { font-weight: 900; font-size: 18px; letter-spacing: 0.02em; color: var(--zt-fg); }

/* 햄버거 (모바일) */
.zt__burger { display: none; width: 38px; height: 38px; border-radius: 10px; flex-direction: column; gap: 4px; align-items: center; justify-content: center; }
.zt__burger span { display: block; width: 19px; height: 2px; border-radius: 2px; background: var(--zt-fg); transition: .22s; }
#zzan_topbar[data-open="1"] .zt__burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
#zzan_topbar[data-open="1"] .zt__burger span:nth-child(2) { opacity: 0; }
#zzan_topbar[data-open="1"] .zt__burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* 전체 서비스 버튼 (데스크톱) */
.zt__services-btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; color: var(--zt-fg); font-weight: 700; font-size: 14.5px; }
.zt__services-btn:hover { background: var(--zt-surface); }
.zt__services-btn svg { width: 17px; height: 17px; color: var(--zt-accent-deep); }

.zt__spacer { flex: 1; }

/* 인증 영역 */
.zt__auth { display: flex; align-items: center; gap: 8px; }
.zt__btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 15px; border-radius: 999px; font-weight: 700; font-size: 13.5px; white-space: nowrap; transition: .15s; }
/* #zzan_topbar a{color:inherit} 보다 우선하도록 ID 스코프 (로그인 글씨 흰색 보장) */
#zzan_topbar .zt__btn--ghost { color: var(--zt-fg-soft); }
#zzan_topbar .zt__btn--ghost:hover { background: var(--zt-surface); color: var(--zt-fg); }
#zzan_topbar .zt__btn--primary { background: var(--zt-accent); color: #fff; box-shadow: 0 4px 14px rgba(0,102,255,.3); }
.zt__btn--primary:hover { filter: brightness(1.05); }
.zt__me { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; }
.zt__me:hover { background: var(--zt-surface); }
.zt__me-img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; }
.zt__me-img--ph { background: var(--zt-accent); color: #fff; font-weight: 800; font-size: 14px; }
.zt__me-nick { font-weight: 700; font-size: 13.5px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 전체 서비스 패널 */
.zt__backdrop { display: none; position: fixed; inset: 0; z-index: 999; background: rgba(8, 20, 16, 0.45); }
#zzan_topbar[data-open="1"] .zt__backdrop { display: block; }

.zt__panel {
    position: absolute; left: 50%; top: calc(var(--zt-h) + 8px); transform: translateX(-50%) translateY(-8px);
    width: min(900px, calc(100vw - 28px)); max-height: calc(100vh - var(--zt-h) - 24px); overflow-y: auto;
    background: var(--zt-bg); color: var(--zt-fg);
    border: 1px solid var(--zt-border); border-radius: var(--zt-radius); box-shadow: var(--zt-shadow);
    opacity: 0; visibility: hidden; pointer-events: none; transition: .2s; z-index: 1001;
}
#zzan_topbar[data-open="1"] .zt__panel { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.zt__panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--zt-border); position: sticky; top: 0; background: var(--zt-bg); }
.zt__panel-head strong { font-size: 15px; font-weight: 800; }
.zt__panel-close { font-size: 26px; line-height: 1; color: var(--zt-fg-soft); width: 34px; height: 34px; border-radius: 9px; }
.zt__panel-close:hover { background: var(--zt-surface); color: var(--zt-fg); }
.zt__panel-body { padding: 8px 20px 16px; }
.zt__panel-empty { padding: 40px 20px; text-align: center; color: var(--zt-fg-soft); font-size: 14px; }
.zt__panel-foot { display: block; padding: 14px 20px; border-top: 1px solid var(--zt-border); color: var(--zt-accent-deep); font-weight: 700; font-size: 13.5px; text-align: center; }

.zt__sec { padding: 14px 0; }
.zt__sec + .zt__sec { border-top: 1px solid var(--zt-border); }
.zt__sec-title { margin: 0 0 12px; font-size: 12.5px; font-weight: 800; color: var(--zt-fg-soft); letter-spacing: .03em; }
.zt__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.zt__item { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 11px; transition: .14s; }
.zt__item:hover { background: var(--zt-surface); }
.zt__item.is-soon { opacity: .55; cursor: default; }
.zt__item-ico { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; flex: none; display: grid; place-items: center; background: var(--zt-surface); }
.zt__item-ico--ph { background: var(--zt-accent); color: #fff; font-weight: 800; font-size: 17px; }
.zt__item-body { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.zt__item-title { font-size: 14px; font-weight: 700; color: var(--zt-fg); display: flex; align-items: center; gap: 6px; }
.zt__item-badge { font-style: normal; font-size: 10px; font-weight: 800; color: #fff; background: var(--zt-accent-deep); padding: 1px 6px; border-radius: 999px; }
.zt__item-sub { font-size: 12px; color: var(--zt-fg-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ───────── 모바일: 드로어 전환 ───────── */
@media (max-width: 768px) {
    .zt__burger { display: flex; }
    .zt__services-btn { display: none; }
    .zt__logo-text { display: none; }
    .zt__btn { padding: 7px 12px; font-size: 13px; }
    .zt__me-nick { display: none; }

    .zt__panel {
        position: fixed; left: 0; top: 0; transform: translateX(-100%);
        width: min(340px, 86vw); height: 100%; max-height: none;
        border-radius: 0; border: none; border-right: 1px solid var(--zt-border);
        transition: transform .26s cubic-bezier(.2,.8,.2,1), opacity 0s, visibility 0s; opacity: 1; visibility: visible; pointer-events: auto;
    }
    #zzan_topbar[data-open="1"] .zt__panel { transform: translateX(0); }
    .zt__grid { grid-template-columns: 1fr; }
}
