    .ig-widget {
        --bg: #fafafa;
        --card-bg: #fff;
        --text: #1c1c1e;
        --muted: #6b7280;
        --border: #e5e7eb;
        box-sizing: border-box;
    }
    .ig-widget * { box-sizing: border-box; }

    /* Reglas de página completa: solo aplican en index.php (standalone),
       gracias a la clase ig-standalone en <body>. No deben afectar al
       resto del sitio cuando el widget se embebe en otra página. */
    body.ig-standalone {
        --bg: #fafafa;
        --text: #1c1c1e;
        --muted: #6b7280;
        margin: 0;
        padding: 32px 20px;
        font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
        background: var(--bg);
        color: var(--text);
        color-scheme: light dark;
    }
    .ig-standalone header {
        max-width: 1100px;
        margin: 0 auto 24px;
    }
    .ig-standalone h1 { margin: 0 0 4px; font-size: 24px; }
    .updated { color: var(--muted); font-size: 14px; }

    /* Reglas del widget en sí: escopadas a .ig-widget para no chocar con
       el CSS del sitio donde se embeba. */
    .ig-widget .grid {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }
    .ig-widget .card {
        display: block;
        background: var(--card-bg);
        border-radius: 12px;
        overflow: hidden;
        text-decoration: none;
        color: inherit;
        transition: transform .15s ease, box-shadow .15s ease;
    }
    .ig-widget .card:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0,0,0,.08);
    }
    .ig-widget .card img {
        width: 100%;
        aspect-ratio: 1 / 1;
        object-fit: cover;
        display: block;
        border-radius: 12px;
        background: #eee;
    }
    .ig-widget .card-body { padding: 12px 14px; }
    .ig-widget .caption {
        margin: 10px 0 8px;
        font-size: 18px;
        font-weight: 400;
        line-height: 1.35;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .ig-widget .meta {
        display: flex;
        gap: 22px;
        margin: 0 0 8px;
        font-size: 20px;
        color: var(--muted);
    }
    .ig-widget .empty {
        max-width: 1100px;
        margin: 40px auto;
        text-align: center;
        color: var(--muted);
    }