/* tad.kr 하단 App Bar — 글래스 반투명 (바·플라이아웃 공통) */
:root {
    --pmgr-bar-h: 52px;
    --pmgr-glass-bg: rgba(255, 255, 255, 0.52);
    --pmgr-glass-border: rgba(230, 232, 235, 0.55);
    --pmgr-glass-blur: 14px;
    --pmgr-flyout-bg: rgba(255, 255, 255, 0.85);
    --pmgr-flyout-border: rgba(220, 224, 230, 0.85);
}

.pmgr-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 900;
    min-height: var(--pmgr-bar-h, 52px);
    height: var(--pmgr-bar-h, 52px);
    background: var(--pmgr-glass-bg);
    backdrop-filter: blur(var(--pmgr-glass-blur));
    -webkit-backdrop-filter: blur(var(--pmgr-glass-blur));
    border-top: 0.5px solid var(--pmgr-glass-border);
    font-family: Pretendard, -apple-system, sans-serif;
    font-size: 13px;
    color: #333;
    display: flex;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);
    overflow: visible;
    box-sizing: border-box;
    padding-right: max(6px, env(safe-area-inset-right, 0px));
}

.pmgr-bar__viewport {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.pmgr-bar__scroll {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: thin;
    min-width: 0;
    box-sizing: border-box;
}
.pmgr-bar__scroll--multi {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    overflow-y: hidden;
}
.pmgr-bar__row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: thin;
    width: 100%;
    box-sizing: border-box;
}

.pmgr-bar__scroll--align-left { justify-content: flex-start; }
.pmgr-bar__scroll--align-center { justify-content: center; }
.pmgr-bar__scroll--align-right { justify-content: flex-end; }
.pmgr-bar__scroll--align-between { justify-content: space-between; }
.pmgr-bar__scroll--align-around { justify-content: space-around; }

.pmgr-bar__row--align-left { justify-content: flex-start; }
.pmgr-bar__row--align-center { justify-content: center; }
.pmgr-bar__row--align-right { justify-content: flex-end; }
.pmgr-bar__row--align-between { justify-content: space-between; }
.pmgr-bar__row--align-around { justify-content: space-around; }

html:not([data-pmgr-ready]) #pmgr-bar-root.pmgr-bar {
    opacity: 0;
}
html[data-pmgr-ready] #pmgr-bar-root.pmgr-bar {
    opacity: 1;
    transition: opacity 150ms ease-out;
}

.pmgr-bar__item {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: auto;
    max-width: none;
    padding: 4px 12px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
    transition: background 0.15s;
}
.pmgr-bar__item:hover { background: rgba(24, 119, 210, 0.14); }

.pmgr-bar__line1 {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.pmgr-bar__icon { flex-shrink: 0; font-size: 15px; line-height: 1; }
.pmgr-bar__icon-img {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    object-fit: contain;
    display: block;
}
.pmgr-bar__name { flex-shrink: 0; font-weight: 600; white-space: nowrap; }
.pmgr-bar__ver { flex-shrink: 0; color: #1877d2; font-weight: 600; font-size: 12px; white-space: nowrap; }
.pmgr-bar__status {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    text-transform: lowercase;
    padding: 1px 6px;
    border-radius: 4px;
}
.pmgr-bar__status--live { background: rgba(34, 197, 94, 0.15); color: #15803d; }
.pmgr-bar__status--beta { background: rgba(59, 130, 246, 0.15); color: #1d4ed8; }
.pmgr-bar__status--maintenance { background: rgba(239, 68, 68, 0.12); color: #b91c1c; }
.pmgr-bar__status--stopped { background: rgba(100, 100, 100, 0.15); color: #555; }

.pmgr-bar__tagline {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pmgr-bar__title {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #666;
    padding: 0 4px;
    white-space: nowrap;
}

.pmgr-bar__divider {
    flex-shrink: 0;
    align-self: center;
    width: 2px;
    min-width: 2px;
    height: 24px;
    background: rgba(0, 0, 0, 0.2);
    margin: 0 4px;
}

.pmgr-bar__counter-slot {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    margin-left: 8px;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.18);
    cursor: default;
}

.pmgr-bar__counter-num {
    font-size: 13px;
    font-weight: 700;
    color: #1e50a2;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    letter-spacing: -0.01em;
}


.pmgr-bar__counter-popup {
    display: none;
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    z-index: 9999;
    min-width: 160px;
    padding: 10px 12px;
    background: var(--pmgr-flyout-bg);
    backdrop-filter: blur(var(--pmgr-glass-blur));
    -webkit-backdrop-filter: blur(var(--pmgr-glass-blur));
    border: 0.5px solid var(--pmgr-flyout-border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    font-size: 11px;
    color: #444;
    white-space: nowrap;
}

.pmgr-bar__counter-slot.is-popup-open .pmgr-bar__counter-popup {
    display: block;
}

.pmgr-bar__counter-popup-title {
    margin: 0 0 8px;
    font-weight: 600;
    font-size: 11px;
    color: #666;
}

.pmgr-bar__counter-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 56px;
}

.pmgr-bar__counter-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    gap: 2px;
}

.pmgr-bar__counter-bar-count {
    font-size: 8px;
    font-weight: bold;
    color: #555;
    line-height: 1;
    white-space: nowrap;
    min-height: 9px;
}

.pmgr-bar__counter-bar {
    width: 100%;
    min-width: 4px;
    background: #333;
    border-radius: 2px 2px 0 0;
    opacity: 0.85;
}

.pmgr-bar__counter-bar.is-zero { background: #ddd; opacity: 0.5; }

.pmgr-bar__counter-bar.is-today {
    background: #1877d2;
    opacity: 0.9;
}

.pmgr-bar__counter-bar.is-zero.is-today {
    background: #1877d2;
    opacity: 0.35;
}

.pmgr-bar__counter-bar-dates {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 9px;
    font-weight: bold;
    color: #555;
    line-height: 1;
}

.pmgr-bar__more, .pmgr-bar__admin {
    box-sizing: border-box;
    flex: 0 0 auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-left: 0.5px solid var(--pmgr-glass-border);
    background: transparent;
    cursor: pointer;
    line-height: 1;
    color: #555;
    text-decoration: none;
    overflow: visible;
    align-self: center;
    position: relative;
    z-index: 2;
}

.pmgr-bar__more {
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    font-size: 18px;
}

.pmgr-bar__admin {
    width: 48px;
    min-width: 48px;
    height: 44px;
    padding: 0;
}

.pmgr-bar__more:hover, .pmgr-bar__admin:hover { background: rgba(255, 255, 255, 0.28); color: #1877d2; }

.pmgr-bar__admin-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    overflow: visible;
    pointer-events: none;
}

.pmgr-bar__admin-icon svg {
    display: block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    overflow: visible;
}

/* reCAPTCHA v3 배지 — 하단 바 위로 (JS에서도 재적용) */
.grecaptcha-badge {
    bottom: calc(var(--pmgr-bar-h, 52px) + 14px) !important;
    z-index: 850 !important;
}

.pmgr-flyout-backdrop {
    position: fixed; inset: 0; z-index: 950;
    background: rgba(0, 0, 0, 0.18);
}
.pmgr-flyout {
    position: fixed;
    left: 12px;
    transform: none;
    bottom: calc(var(--pmgr-bar-h, 52px) + 8px);
    z-index: 960;
    width: min(360px, calc(100vw - 24px));
    max-height: min(400px, 70vh);
    overflow: auto;
    background: var(--pmgr-flyout-bg);
    backdrop-filter: blur(var(--pmgr-glass-blur));
    -webkit-backdrop-filter: blur(var(--pmgr-glass-blur));
    border: 0.5px solid var(--pmgr-flyout-border);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    padding: 16px;
    font-family: Pretendard, sans-serif;
    font-size: 14px;
    color: #333;
}

.pmgr-flyout__head { margin-bottom: 12px; }
.pmgr-flyout__title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.pmgr-flyout__title-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 18px;
    line-height: 1;
}
.pmgr-flyout__title-icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
}
.pmgr-flyout__title-name {
    min-width: 0;
    flex: 1;
    line-height: 1.3;
}
.pmgr-flyout__os-chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 11px;
    font-weight: 600;
    color: #555;
    line-height: 1;
}
.pmgr-flyout__os-chip-inner {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.pmgr-flyout__os-part {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.pmgr-flyout__os-sep {
    color: #aaa;
    font-weight: 400;
    user-select: none;
}
.pmgr-flyout__os-icon {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}
.pmgr-flyout__os-icon--win { color: #0078d4; }
.pmgr-flyout__os-icon--mac { color: #555; }
.pmgr-flyout__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.85rem;
    color: #666;
}
.pmgr-flyout__meta-main { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.pmgr-flyout__meta-date {
    flex-shrink: 0;
    margin-left: auto;
    font-size: 0.8rem;
    color: #888;
    white-space: nowrap;
}
.pmgr-flyout__tabs { display: flex; gap: 6px; margin-bottom: 12px; border-bottom: 1px solid rgba(229, 231, 235, 0.6); padding-bottom: 8px; }
.pmgr-flyout__tab {
    padding: 6px 12px; border: none; background: transparent; border-radius: 6px;
    cursor: pointer; font: inherit; font-size: 0.85rem; color: #666;
}
.pmgr-flyout__tab.is-active { background: rgba(24, 119, 210, 0.12); color: #1877d2; font-weight: 600; }
.pmgr-flyout__panel { display: none; }
.pmgr-flyout__panel.is-active { display: block; }
.pmgr-flyout__desc {
    color: #444;
    line-height: 1.55;
    margin-bottom: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}
.pmgr-flyout__note {
    font-size: 0.85rem; color: #666; white-space: pre-wrap; word-break: break-word; margin-bottom: 12px; padding: 10px;
    background: rgba(245, 247, 250, 0.95); border-radius: 8px;
}
.pmgr-flyout__md {
    color: #444;
    line-height: 1.55;
    word-break: break-word;
}
.pmgr-flyout__md p {
    margin: 0;
}
.pmgr-flyout__md ul {
    margin: 0;
    padding-left: 1.2em;
}
.pmgr-flyout__md li {
    margin: 0;
}
.pmgr-flyout__md h2 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0.65em 0 0.2em;
}
.pmgr-flyout__md h2:first-child {
    margin-top: 0;
}
.pmgr-flyout__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(229, 231, 235, 0.6); }
.pmgr-flyout__btn {
    padding: 8px 14px; border-radius: 8px; border: 1px solid #d8dee5;
    background: rgba(255, 255, 255, 0.95); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; color: #333;
    display: inline-flex; align-items: center;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.pmgr-flyout__btn:hover,
.pmgr-flyout__btn:focus-visible {
    background: #f0f4f8;
    border-color: #b8c4d0;
    color: #222;
    text-decoration: none;
}
.pmgr-flyout__btn--primary,
.pmgr-flyout__btn--primary:visited {
    background: #1877d2;
    border-color: #1877d2;
    color: #fff;
}
.pmgr-flyout__btn--primary:hover,
.pmgr-flyout__btn--primary:focus-visible,
.pmgr-flyout__btn--primary:visited:hover {
    background: #1565bd;
    border-color: #1565bd;
    color: #fff;
    text-decoration: none;
}

.pmgr-overflow-menu {
    position: fixed; z-index: 940;
    background: var(--pmgr-flyout-bg);
    backdrop-filter: blur(var(--pmgr-glass-blur));
    -webkit-backdrop-filter: blur(var(--pmgr-glass-blur));
    border: 0.5px solid var(--pmgr-flyout-border);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    padding: 8px;
    min-width: 180px;
    max-height: min(280px, 50vh);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.pmgr-overflow-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 36px;
    text-align: left;
    padding: 8px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    line-height: 1;
    color: #333;
    border-radius: 8px;
}
.pmgr-overflow-menu__icon {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pmgr-overflow-menu__icon .pmgr-bar__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
}
.pmgr-overflow-menu__icon .pmgr-bar__icon-img {
    width: 16px;
    height: 16px;
}
.pmgr-overflow-menu__label {
    flex: 1;
    min-width: 0;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pmgr-overflow-menu button:hover { background: rgba(24,119,210,0.1); }

/* 관리자 Flyout 미리보기 — fixed 오버레이 대신 인라인 (admin.css !important 대체) */
.pmgr-flyout.pmgr-flyout--embedded {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    top: auto;
    transform: none;
    z-index: auto;
    width: 100%;
    max-width: none;
    max-height: none;
    overflow: visible;
    box-sizing: border-box;
}

.bar-layout-preview.pmgr-bar {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
