.tp-offline-hub {
    position: fixed;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 10000;
}

.tp-offline-status {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, 0.22);
    border-radius: 999px;
    background: #4b5563;
    color: #fff;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
    font: 600 13px/1.2 system-ui, sans-serif;
    text-decoration: none;
    cursor: pointer;
}

.tp-offline-status::before {
    content: "";
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.tp-offline-status.is-online {
    background: #166534;
    color: #fff;
}

.tp-offline-status.is-syncing {
    background: #1d4ed8;
    color: #fff;
}

.tp-offline-status.is-offline {
    background: #c2410c;
    color: #fff;
}

.tp-offline-status.has-pending {
    background: #a16207;
    color: #fff;
}

.tp-offline-status.has-error {
    background: #b91c1c;
    color: #fff;
}

.tp-offline-status.is-syncing::before {
    animation: tp-offline-pulse 1.1s ease-in-out infinite;
}

@keyframes tp-offline-pulse {
    0%, 100% { opacity: 0.45; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
    .tp-offline-status.is-syncing::before { animation: none; }
}

.tp-offline-status:hover,
.tp-offline-status:focus-visible {
    filter: brightness(1.08);
    color: #fff;
}

.tp-offline-menu[hidden] { display: none !important; }

.tp-offline-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 9px);
    min-width: 210px;
    padding: 8px;
    border: 1px solid rgba(0,0,0,.2);
    border-radius: 12px;
    background: #fff;
    color: #222;
    box-shadow: 0 8px 28px rgba(0,0,0,.22);
}
.tp-offline-menu strong { display:block; padding:7px 9px 5px; font-size:13px; }
.tp-offline-menu a { display:block; padding:9px; border-radius:8px; color:#222; text-decoration:none; font-weight:600; }
.tp-offline-menu a:hover, .tp-offline-menu a:focus-visible { background:#f2ead8; color:#111; }


.tp-sync-toast {
    position: fixed;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(62px, calc(env(safe-area-inset-bottom) + 62px));
    z-index: 10001;
    max-width: min(360px, calc(100vw - 24px));
    padding: 11px 14px;
    border-radius: 10px;
    background: #153b60;
    color: #fff;
    box-shadow: 0 8px 26px rgba(0,0,0,.24);
    font: 700 13px/1.35 system-ui, sans-serif;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .18s ease, transform .18s ease;
    pointer-events: none;
}
.tp-sync-toast.is-visible { opacity: 1; transform: translateY(0); }
.tp-sync-toast.is-error { background: #991b1b; }
