:root {
    --hub-bg: #06120d;
    --hub-bg-soft: #0c1a14;
    --hub-surface: rgba(255, 255, 255, 0.04);
    --hub-surface-hover: rgba(255, 255, 255, 0.08);
    --hub-border: rgba(255, 255, 255, 0.08);
    --hub-text: #f8fafc;
    --hub-muted: #94a3b8;
    --hub-primary: #10b981;
    --hub-primary-soft: rgba(16, 185, 129, 0.18);
    --hub-success: #10b981;
    --hub-danger: #ef4444;
    --hub-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    --hub-radius: 18px;
    --hub-radius-sm: 12px;
    --hub-font: "Inter", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--hub-font);
    color: var(--hub-text);
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(16, 185, 129, 0.22), transparent 60%),
        radial-gradient(ellipse 60% 50% at 100% 100%, rgba(20, 184, 166, 0.15), transparent 55%),
        linear-gradient(170deg, #06120d 0%, #04100c 50%, #050d0a 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

.hub-page {
    position: relative;
}

/* Animated aurora ribbons */
.hub-page::before,
.hub-page::after {
    content: "";
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

.hub-page::before {
    width: 460px;
    height: 460px;
    top: -140px;
    right: -90px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.45), transparent 70%);
    animation: hub-drift-a 18s ease-in-out infinite;
}

.hub-page::after {
    width: 400px;
    height: 400px;
    bottom: -120px;
    left: -70px;
    background: radial-gradient(circle, rgba(45, 212, 191, 0.32), transparent 70%);
    animation: hub-drift-b 22s ease-in-out infinite;
}

@keyframes hub-drift-a {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-60px, 50px) scale(1.15); }
}

@keyframes hub-drift-b {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, -40px) scale(1.2); }
}

.hub-container {
    position: relative;
    z-index: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

.hub-hero {
    text-align: center;
    margin-bottom: 40px;
}

.hub-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    background: linear-gradient(120deg, rgba(16, 185, 129, 0.22), rgba(45, 212, 191, 0.18));
    border: 1px solid rgba(52, 211, 153, 0.32);
    color: #a7f3d0;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 18px;
    box-shadow: 0 0 24px rgba(16, 185, 129, 0.2);
}

.hub-hero-badge i {
    color: #34d399;
    animation: hub-badge-spin 6s linear infinite;
}

@keyframes hub-badge-spin {
    0%, 70% { transform: rotate(0); }
    85%, 100% { transform: rotate(360deg); }
}

.hub-hero h1 {
    font-size: clamp(2.4rem, 5.5vw, 3.8rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin: 0 0 14px;
    background: linear-gradient(120deg, #f8fafc 20%, #6ee7b7 55%, #2dd4bf 90%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: hub-title-shine 8s linear infinite;
    text-shadow: 0 0 60px rgba(16, 185, 129, 0.25);
}

@keyframes hub-title-shine {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.hub-hero p {
    color: var(--hub-muted);
    font-size: 1.05rem;
    max-width: 640px;
    margin: 0 auto;
}

/* ===== Two-column layout: apps left, floating ad right ===== */
.hub-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 32px;
    align-items: start;
}

.hub-main {
    min-width: 0;
}

.hub-aside {
    position: sticky;
    top: 24px;
    align-self: start;
}

.hub-main .hub-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

@media (max-width: 1024px) {
    .hub-layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .hub-aside {
        position: static;
        top: auto;
    }
}

/* ===== Hire-me promo banner ===== */
.hub-promo {
    position: relative;
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 32px;
    align-items: center;
    text-decoration: none;
    color: inherit;
    margin-bottom: 40px;
    padding: 36px;
    border-radius: 26px;
    border: 1px solid rgba(52, 211, 153, 0.28);
    background:
        radial-gradient(circle at 100% 0%, rgba(45, 212, 191, 0.16), transparent 45%),
        radial-gradient(circle at 0% 100%, rgba(16, 185, 129, 0.22), transparent 50%),
        linear-gradient(160deg, rgba(6, 32, 24, 0.9), rgba(17, 24, 39, 0.92));
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.hub-promo:hover {
    transform: translateY(-4px);
    border-color: rgba(52, 211, 153, 0.55);
    box-shadow: 0 30px 70px rgba(5, 150, 105, 0.32);
}

.hub-promo-glow {
    position: absolute;
    width: 520px;
    height: 520px;
    top: -240px;
    right: -120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.5), transparent 65%);
    filter: blur(60px);
    opacity: 0.7;
    pointer-events: none;
    animation: hub-promo-pulse 6s ease-in-out infinite;
}

@keyframes hub-promo-pulse {
    0%, 100% { opacity: 0.45; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.12); }
}

.hub-promo-content {
    position: relative;
    z-index: 1;
}

.hub-promo-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(45, 212, 191, 0.16);
    color: #99f6e4;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.hub-promo-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2dd4bf;
    box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.25);
    animation: hub-blink 1.6s ease-in-out infinite;
}

@keyframes hub-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.hub-promo-title {
    font-size: clamp(1.7rem, 3.4vw, 2.6rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin: 0 0 14px;
}

.hub-promo-gradient {
    display: inline-block;
    background: linear-gradient(110deg, #34d399, #2dd4bf 60%, #5eead4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.hub-promo-sub {
    color: #cbd5e1;
    font-size: 1rem;
    line-height: 1.6;
    max-width: 560px;
    margin: 0 0 20px;
}

.hub-promo-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.hub-promo-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 600;
}

.hub-promo-pill i { color: #6ee7b7; }

.hub-promo-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    margin-bottom: 22px;
}

.hub-promo-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 24px;
    border-radius: 12px;
    background: linear-gradient(135deg, #10b981, #2dd4bf);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hub-promo:hover .hub-promo-cta {
    transform: translateX(2px);
    box-shadow: 0 16px 40px rgba(45, 212, 191, 0.45);
}

.hub-promo-cta i { transition: transform 0.2s ease; }
.hub-promo:hover .hub-promo-cta i { transform: translateX(4px); }

.hub-promo-cta-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--hub-muted);
    font-size: 14px;
    font-weight: 600;
}

.hub-promo-rotator {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    font-size: 14px;
    font-style: italic;
    line-height: 1.5;
    max-width: 560px;
}

.hub-promo-rotator i {
    color: #34d399;
    margin-top: 3px;
    flex-shrink: 0;
}

.hub-promo-rotator span {
    transition: opacity 0.4s ease;
}

.hub-promo-rotator span.is-fading { opacity: 0; }

/* Promo visual / mockup */
.hub-promo-visual {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
}

.hub-promo-window {
    width: 100%;
    max-width: 340px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: #06120d;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    transform: perspective(1000px) rotateY(-12deg) rotateX(4deg);
    transition: transform 0.4s ease;
}

.hub-promo:hover .hub-promo-window {
    transform: perspective(1000px) rotateY(-6deg) rotateX(2deg) translateY(-4px);
}

.hub-promo-window-bar {
    display: flex;
    gap: 6px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hub-promo-window-bar span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
}

.hub-promo-window-bar span:first-child { background: #f87171; }
.hub-promo-window-bar span:nth-child(2) { background: #fbbf24; }
.hub-promo-window-bar span:nth-child(3) { background: #34d399; }

.hub-promo-window-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hub-promo-skeleton {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(16,185,129,0.4), rgba(45,212,191,0.3));
    background-size: 200% 100%;
    animation: hub-shimmer 2.4s ease-in-out infinite;
}

.hub-promo-skeleton-hero {
    height: 60px;
    border-radius: 10px;
    margin-bottom: 4px;
}

@keyframes hub-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.hub-promo-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 6px;
}

.hub-promo-cards div {
    height: 44px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.hub-promo-float {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f8fafc;
    font-size: 12.5px;
    font-weight: 600;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    animation: hub-float 4s ease-in-out infinite;
}

.hub-promo-float i { color: #fbbf24; }
.hub-promo-float-1 { top: 6%; right: -4%; animation-delay: 0s; }
.hub-promo-float-2 { bottom: 8%; left: -6%; animation-delay: 1.4s; }
.hub-promo-float-2 i { color: #5eead4; }

@keyframes hub-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ===== Promo in floating sidebar (stacked, compact) ===== */
.hub-promo-aside {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 26px;
    margin-bottom: 0;
}

.hub-promo-aside .hub-promo-visual {
    min-height: 0;
}

.hub-promo-aside .hub-promo-window {
    max-width: 100%;
    transform: none;
}

.hub-promo-aside:hover .hub-promo-window {
    transform: translateY(-3px);
}

.hub-promo-aside .hub-promo-title {
    font-size: clamp(1.45rem, 1.4vw, 1.8rem);
}

.hub-promo-aside .hub-promo-sub {
    font-size: 0.94rem;
    margin-bottom: 16px;
}

.hub-promo-aside .hub-promo-pills {
    margin-bottom: 18px;
}

.hub-promo-aside .hub-promo-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 18px;
}

.hub-promo-aside .hub-promo-cta,
.hub-promo-aside .hub-promo-cta-secondary {
    justify-content: center;
}

.hub-promo-aside .hub-promo-rotator {
    max-width: none;
}

/* ===== Closing call-to-action ===== */
.hub-cta {
    position: relative;
    margin-top: 56px;
    padding: 48px 32px;
    border-radius: 26px;
    text-align: center;
    overflow: hidden;
    border: 1px solid rgba(52, 211, 153, 0.24);
    background:
        radial-gradient(circle at 50% 0%, rgba(45, 212, 191, 0.16), transparent 55%),
        linear-gradient(160deg, rgba(6, 32, 24, 0.85), rgba(17, 24, 39, 0.9));
}

.hub-cta-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 120%, rgba(16, 185, 129, 0.35), transparent 60%);
    pointer-events: none;
}

.hub-cta-inner {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
}

.hub-cta-inner h2 {
    font-size: clamp(1.6rem, 3.2vw, 2.3rem);
    line-height: 1.12;
    letter-spacing: -0.03em;
    margin: 0 0 12px;
}

.hub-cta-inner p {
    color: #cbd5e1;
    font-size: 1.02rem;
    margin: 0 0 26px;
}

.hub-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
}

.hub-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 26px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.hub-cta-btn-primary {
    background: linear-gradient(135deg, #10b981, #2dd4bf);
    color: #fff;
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.4);
}

.hub-cta-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 44px rgba(45, 212, 191, 0.45);
}

.hub-cta-btn-primary i { transition: transform 0.2s ease; }
.hub-cta-btn-primary:hover i { transform: translateX(4px); }

.hub-cta-btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
}

.hub-cta-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(52, 211, 153, 0.45);
}

@media (max-width: 860px) {
    .hub-promo {
        grid-template-columns: 1fr;
        padding: 28px 22px;
    }
    .hub-promo-visual {
        order: -1;
        min-height: 0;
    }
    .hub-promo-window {
        transform: none;
        max-width: 100%;
    }
    .hub-promo:hover .hub-promo-window { transform: translateY(-2px); }
    .hub-promo-float { display: none; }
}

.hub-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.hub-search {
    position: relative;
    flex: 1 1 320px;
    max-width: 520px;
}

.hub-search i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--hub-muted);
}

.hub-search input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border-radius: 999px;
    border: 1px solid var(--hub-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--hub-text);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.hub-search input:focus {
    border-color: rgba(16, 185, 129, 0.55);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.hub-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hub-filter-btn {
    border: 1px solid var(--hub-border);
    background: transparent;
    color: var(--hub-muted);
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hub-filter-btn:hover,
.hub-filter-btn.active {
    color: var(--hub-text);
    border-color: rgba(16, 185, 129, 0.45);
    background: var(--hub-primary-soft);
}

.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.hub-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px;
    border-radius: var(--hub-radius);
    border: 1px solid var(--hub-border);
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    overflow: hidden;
}

/* Animated accent line that sweeps in on hover */
.hub-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--card-accent, #10b981), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
    z-index: 2;
}

.hub-card:hover::after,
.hub-card:focus-visible::after {
    transform: translateX(100%);
}

.hub-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, var(--card-accent-soft, rgba(16,185,129,0.12)), transparent 55%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.hub-card:hover,
.hub-card:focus-visible {
    transform: translateY(-5px);
    border-color: color-mix(in srgb, var(--card-accent, #10b981) 50%, transparent);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4), 0 0 30px color-mix(in srgb, var(--card-accent, #10b981) 22%, transparent);
}

.hub-card:hover::before,
.hub-card:focus-visible::before {
    opacity: 1;
}

.hub-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.hub-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: var(--card-accent-soft, rgba(16,185,129,0.18));
    color: var(--card-accent, #6ee7b7);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hub-card:hover .hub-card-icon {
    transform: scale(1.08) rotate(-4deg);
    box-shadow: 0 0 24px color-mix(in srgb, var(--card-accent, #10b981) 45%, transparent);
}

.hub-card-domain {
    font-size: 12px;
    color: var(--hub-muted);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.hub-card h3 {
    margin: 0;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.hub-card p {
    margin: 0;
    color: var(--hub-muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.hub-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    font-size: 12px;
    color: #cbd5e1;
}

.hub-card-footer span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hub-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 64px 24px;
    border: 1px dashed var(--hub-border);
    border-radius: var(--hub-radius);
    color: var(--hub-muted);
}

.hub-footer {
    margin-top: 48px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    color: var(--hub-muted);
    font-size: 14px;
}

.hub-footer a {
    color: #a7f3d0;
    text-decoration: none;
}

.hub-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hub-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--hub-success);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
}

.hub-status-dot.offline {
    background: var(--hub-danger);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.18);
}

.hub-preview-flyout {
    position: fixed;
    z-index: 1000;
    width: min(480px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px) scale(0.98);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.hub-preview-flyout.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.hub-preview-shell {
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.12);
    background: #0a1712;
    box-shadow: var(--hub-shadow);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 32px);
}

.hub-preview-media {
    position: relative;
    width: 100%;
    height: min(380px, 52vh);
    min-height: 220px;
    flex-shrink: 0;
    overflow: hidden;
    background: #0c1a14;
}

.hub-preview-media iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #fff;
    z-index: 1;
}

.hub-preview-media img.hub-preview-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    object-fit: cover;
    object-position: top center;
    background: #0c1a14;
    z-index: 1;
}

.hub-preview-loading {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--hub-muted);
    font-size: 13px;
    background: rgba(15, 23, 42, 0.88);
    pointer-events: none;
}

.hub-preview-loading[hidden],
.hub-preview-loading:not(.is-active) {
    display: none !important;
}

.hub-preview-loading i {
    animation: hub-spin 1s linear infinite;
}

@keyframes hub-spin {
    to { transform: rotate(360deg); }
}

.hub-preview-meta {
    padding: 14px 16px 16px;
    flex-shrink: 0;
}

.hub-preview-meta h4 {
    margin: 0 0 4px;
    font-size: 15px;
}

.hub-preview-meta p {
    margin: 0;
    color: var(--hub-muted);
    font-size: 13px;
    line-height: 1.45;
}

.hub-preview-meta small {
    display: block;
    margin-top: 8px;
    color: #cbd5e1;
    font-size: 12px;
}

/* Shared form/button styles */
.hub-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 12px;
    padding: 11px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.hub-btn-primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.hub-btn-primary:hover { filter: brightness(1.05); }

.hub-btn-ghost {
    background: rgba(255,255,255,0.04);
    color: var(--hub-text);
    border: 1px solid var(--hub-border);
}

.hub-btn-ghost:hover { background: rgba(255,255,255,0.08); }

.hub-btn-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #fecaca;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.hub-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.hub-form label span {
    font-size: 13px;
    font-weight: 600;
    color: #cbd5e1;
}

.hub-form label small { color: var(--hub-muted); font-weight: 400; }

.hub-form input,
.hub-form select,
.hub-form textarea {
    width: 100%;
    border: 1px solid var(--hub-border);
    background: #13241c;
    color: var(--hub-text);
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    outline: none;
}

.hub-select {
    color-scheme: dark;
    cursor: pointer;
}

.hub-form select option {
    background: #13241c;
    color: #f8fafc;
}

.hub-form input:focus,
.hub-form select:focus,
.hub-form textarea:focus {
    border-color: rgba(16, 185, 129, 0.55);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.hub-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
}

.hub-form-full { grid-column: 1 / -1; }

.hub-alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
}

.hub-alert-error {
    background: rgba(239, 68, 68, 0.12);
    color: #fecaca;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Auth */
.hub-auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(circle at top right, rgba(16,185,129,0.22), transparent 35%),
        var(--hub-bg);
}

.hub-auth-card {
    width: min(420px, 100%);
    padding: 32px;
    border-radius: 24px;
    border: 1px solid var(--hub-border);
    background: rgba(255,255,255,0.04);
    box-shadow: var(--hub-shadow);
}

.hub-auth-brand {
    text-align: center;
    margin-bottom: 24px;
}

.hub-auth-brand i {
    font-size: 28px;
    color: #6ee7b7;
    margin-bottom: 10px;
}

.hub-auth-brand h1 { margin: 0 0 6px; }
.hub-auth-brand p { margin: 0; color: var(--hub-muted); }

.hub-auth-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    color: var(--hub-muted);
    text-decoration: none;
    font-size: 14px;
}

/* Admin */
.hub-admin-page { background: #06120d; min-height: 100vh; }

.hub-admin-header {
    border-bottom: 1px solid var(--hub-border);
    background: rgba(255,255,255,0.02);
}

.hub-admin-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.hub-admin-header h1 {
    margin: 0 0 4px;
    font-size: 1.5rem;
}

.hub-admin-header p {
    margin: 0;
    color: var(--hub-muted);
}

.hub-admin-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hub-admin-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.hub-admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.hub-admin-hint {
    color: var(--hub-muted);
    font-size: 13px;
    margin: 0;
}

.hub-admin-table-wrap {
    border: 1px solid var(--hub-border);
    border-radius: 18px;
    overflow: hidden;
    background: rgba(255,255,255,0.02);
}

.hub-admin-table {
    width: 100%;
    border-collapse: collapse;
}

.hub-admin-table th,
.hub-admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--hub-border);
    text-align: left;
    vertical-align: middle;
}

.hub-admin-table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--hub-muted);
    background: rgba(255,255,255,0.02);
}

.hub-admin-table tr:last-child td { border-bottom: 0; }

.hub-admin-table .drag-handle {
    color: var(--hub-muted);
    cursor: grab;
}

.hub-link-cell strong {
    display: block;
    margin-bottom: 4px;
}

.hub-link-cell small {
    color: var(--hub-muted);
}

.hub-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.hub-badge-live {
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
}

.hub-badge-hidden {
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
}

.hub-thumb {
    width: 72px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--hub-border);
    background: #0c1a14;
}

.hub-empty {
    text-align: center;
    color: var(--hub-muted);
    padding: 28px;
}

.hub-action-group {
    display: flex;
    gap: 8px;
}

.hub-action-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--hub-border);
    background: rgba(255,255,255,0.03);
    color: var(--hub-text);
    cursor: pointer;
}

.hub-action-btn:hover { background: rgba(255,255,255,0.08); }

.hub-modal[hidden] { display: none; }

.hub-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.hub-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(4px);
}

.hub-modal-panel {
    position: relative;
    width: min(720px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    border-radius: 22px;
    border: 1px solid var(--hub-border);
    background: #0c1a14;
    box-shadow: var(--hub-shadow);
}

.hub-modal-header,
.hub-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--hub-border);
}

.hub-modal-footer {
    border-bottom: 0;
    border-top: 1px solid var(--hub-border);
    justify-content: flex-end;
}

.hub-modal-body { padding: 22px; }

.hub-modal-header h2 { margin: 0; font-size: 1.2rem; }

.hub-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--hub-border);
    background: transparent;
    color: var(--hub-text);
    cursor: pointer;
}

.hub-upload-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.hub-preview-thumb {
    margin-top: 12px;
}

.hub-preview-thumb img {
    max-width: 100%;
    border-radius: 12px;
    border: 1px solid var(--hub-border);
}

.hub-btn-sm {
    padding: 8px 12px;
    font-size: 13px;
}

.hub-icon-field {
    margin-bottom: 14px;
}

.hub-icon-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--hub-border);
    border-radius: 14px;
    background: #0a1712;
    max-height: 180px;
    overflow: auto;
}

.hub-icon-option {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--hub-border);
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.15s ease;
}

.hub-icon-option:hover {
    background: rgba(16, 185, 129, 0.18);
    color: #d1fae5;
    border-color: rgba(16, 185, 129, 0.45);
}

.hub-icon-option.selected {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 8px 18px rgba(5, 150, 105, 0.35);
}

.hub-suggestions {
    margin-bottom: 18px;
    padding: 16px;
    border: 1px solid var(--hub-border);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.55);
}

.hub-suggestions-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.hub-suggestions-header strong {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
}

.hub-suggestions-header p {
    margin: 0;
    color: var(--hub-muted);
    font-size: 12px;
    line-height: 1.45;
}

.hub-suggestions-search {
    position: relative;
    margin-bottom: 12px;
}

.hub-suggestions-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--hub-muted);
    font-size: 13px;
}

.hub-suggestions-search input {
    width: 100%;
    padding: 10px 12px 10px 34px;
    border-radius: 10px;
    border: 1px solid var(--hub-border);
    background: #0a1712;
    color: var(--hub-text);
    font-size: 13px;
}

.hub-suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow: auto;
}

.hub-suggestion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--hub-border);
    background: rgba(255, 255, 255, 0.03);
}

.hub-suggestion-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.16);
    color: #a7f3d0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hub-suggestion-body {
    flex: 1;
    min-width: 0;
}

.hub-suggestion-body strong {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

.hub-suggestion-body small {
    display: block;
    color: var(--hub-muted);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hub-suggestion-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.hub-suggestions-empty {
    color: var(--hub-muted);
    font-size: 13px;
    text-align: center;
    padding: 16px 8px;
    margin: 0;
}

.hub-table-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.16);
    color: #a7f3d0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.hub-modal-preview {
    z-index: 2200;
}

.hub-preview-modal-panel {
    width: min(960px, 100%);
}

.hub-preview-modal-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hub-preview-modal-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.2);
    color: #a7f3d0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.hub-preview-url-label {
    margin: 4px 0 0;
    color: var(--hub-muted);
    font-size: 13px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.hub-discover-preview-frame-wrap {
    position: relative;
    height: min(62vh, 520px);
    background: #0a1712;
    border-top: 1px solid var(--hub-border);
    border-bottom: 1px solid var(--hub-border);
}

.hub-discover-preview-frame-wrap iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #fff;
}

.hub-discover-preview-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--hub-muted);
    font-size: 14px;
    background: rgba(15, 23, 42, 0.92);
    z-index: 1;
}

.hub-discover-preview-loading i {
    animation: hub-spin 1s linear infinite;
}

.hub-discover-preview-loading[hidden] {
    display: none;
}

.hub-preview-modal-footer {
    flex-wrap: wrap;
    gap: 10px;
}

.hub-preview-modal-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.hub-suggestion-body.clickable {
    cursor: pointer;
}

.hub-suggestion-body.clickable:hover strong {
    color: #a7f3d0;
}

.hub-action-btn-preview {
    color: #5eead4;
}

.hub-admin-categories {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid var(--hub-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
}

.hub-admin-categories-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--hub-muted);
    flex-shrink: 0;
}

.hub-admin-category-filters,
.hub-category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hub-category-chip {
    border: 1px solid var(--hub-border);
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.hub-category-chip:hover {
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(16, 185, 129, 0.14);
    color: #d1fae5;
}

.hub-category-chip.active {
    border-color: rgba(16, 185, 129, 0.55);
    background: rgba(16, 185, 129, 0.22);
    color: #f8fafc;
}

.hub-category-field {
    margin-bottom: 14px;
}

.hub-category-field input[list] {
    margin-bottom: 10px;
}

@media (max-width: 900px) {
    .hub-form-grid { grid-template-columns: 1fr; }
    .hub-admin-header-inner { flex-direction: column; align-items: flex-start; }
    .hub-admin-table-wrap { overflow-x: auto; }
}

@media (max-width: 640px) {
    .hub-container { padding-top: 32px; }
    .hub-controls { flex-direction: column; align-items: stretch; }
    .hub-search { max-width: none; }
}

/* ===== Human-verification gate ===== */
.gate-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gate-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(ellipse 70% 60% at 50% 0%, rgba(16, 185, 129, 0.18), transparent 60%),
        rgba(4, 14, 11, 0.86);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.gate-card {
    position: relative;
    width: min(440px, 100%);
    text-align: center;
    padding: 40px 32px 32px;
    border-radius: 26px;
    border: 1px solid rgba(52, 211, 153, 0.28);
    background: linear-gradient(160deg, rgba(12, 26, 20, 0.95), rgba(6, 18, 13, 0.95));
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 40px rgba(16, 185, 129, 0.12);
    animation: gate-rise 0.5s ease both;
}

@keyframes gate-rise {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.gate-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 18px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.gate-card h1 {
    margin: 0 0 8px;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    color: var(--hub-text);
}

.gate-lead {
    margin: 0 0 26px;
    color: var(--hub-muted);
    font-size: 0.95rem;
    line-height: 1.55;
}

.gate-hold {
    position: relative;
    width: 132px;
    height: 132px;
    margin: 0 auto 16px;
    display: block;
    border: 0;
    background: none;
    cursor: pointer;
    border-radius: 50%;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
}

.gate-hold:focus-visible {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.3);
}

.gate-ring-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.gate-ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 7;
}

.gate-ring {
    fill: none;
    stroke: #10b981;
    stroke-width: 7;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.08s linear;
    filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.6));
}

.gate-hold-core {
    position: absolute;
    inset: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    color: #6ee7b7;
    background: radial-gradient(circle at 50% 35%, rgba(16, 185, 129, 0.28), rgba(16, 185, 129, 0.08));
    border: 1px solid rgba(52, 211, 153, 0.35);
    transition: transform 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.gate-holding .gate-hold-core {
    transform: scale(0.94);
    color: #a7f3d0;
    box-shadow: inset 0 0 24px rgba(16, 185, 129, 0.4), 0 0 24px rgba(16, 185, 129, 0.3);
}

.gate-hold-core i { animation: gate-glyph-pulse 2s ease-in-out infinite; }

@keyframes gate-glyph-pulse {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; }
}

.gate-status {
    font-size: 0.95rem;
    font-weight: 600;
    color: #a7f3d0;
    min-height: 22px;
    margin-bottom: 18px;
    letter-spacing: 0.01em;
}

.gate-verifying .gate-status { color: #6ee7b7; }
.gate-error .gate-status { color: #fca5a5; }
.gate-done .gate-status { color: #34d399; }

.gate-done .gate-card {
    transition: opacity 0.5s ease, transform 0.5s ease;
    opacity: 0;
    transform: scale(1.04);
}

.gate-error .gate-hold-core {
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.45);
    background: radial-gradient(circle at 50% 35%, rgba(239, 68, 68, 0.22), rgba(239, 68, 68, 0.06));
    animation: gate-shake 0.4s ease;
}

@keyframes gate-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.gate-foot {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--hub-muted);
    font-size: 12.5px;
    font-weight: 600;
    opacity: 0.8;
}

.gate-foot i { color: #34d399; }

.gate-noscript {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fecaca;
    font-size: 13px;
}
