/*
 * TS Tags & Consent — bàner.
 *
 * Neutre a propòsit: cada tema el pot adaptar redefinint les variables, per
 * exemple a :root { --ts-tc-accent: #ffd400; --ts-tc-accent-fg: #1a1a1a; }.
 * Acceptar i rebutjar comparteixen estil: han de tenir el mateix pes visual.
 */
.ts-tc,
.ts-tc-reopen {
    --ts-tc-bg: #ffffff;
    --ts-tc-fg: #1a1a1a;
    --ts-tc-muted: #5b5b5b;
    --ts-tc-border: #e2e2e2;
    --ts-tc-accent: #1a1a1a;
    --ts-tc-accent-fg: #ffffff;
    --ts-tc-radius: 12px;
    --ts-tc-font: inherit;
}

.ts-tc {
    position: fixed;
    z-index: 2147483000;
    inset: auto 16px 16px 16px;
    display: flex;
    justify-content: center;
    font-family: var(--ts-tc-font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--ts-tc-fg);
}

.ts-tc[hidden],
.ts-tc [hidden],
.ts-tc-reopen[hidden] {
    display: none !important;
}

.ts-tc--center {
    inset: 0;
    align-items: center;
    padding: 16px;
    background: rgb(0 0 0 / 0.35);
}

.ts-tc__box {
    width: 100%;
    max-width: 720px;
    max-height: calc(100vh - 32px);
    overflow: auto;
    padding: 24px;
    background: var(--ts-tc-bg);
    border: 1px solid var(--ts-tc-border);
    border-radius: var(--ts-tc-radius);
    box-shadow: 0 12px 40px rgb(0 0 0 / 0.18);
}

.ts-tc__title {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 600;
}

.ts-tc__body {
    margin: 0;
    color: var(--ts-tc-muted);
}

.ts-tc__link {
    color: var(--ts-tc-fg);
    text-decoration: underline;
}

.ts-tc__prefs {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--ts-tc-border);
}

.ts-tc__pref {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--ts-tc-muted);
    cursor: pointer;
}

.ts-tc__pref strong {
    color: var(--ts-tc-fg);
}

.ts-tc__pref input {
    flex: none;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--ts-tc-accent);
}

.ts-tc__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.ts-tc__btn {
    flex: 1 1 160px;
    min-height: 44px;
    padding: 10px 18px;
    font: inherit;
    font-weight: 600;
    color: var(--ts-tc-accent-fg);
    background: var(--ts-tc-accent);
    border: 1px solid var(--ts-tc-accent);
    border-radius: 999px;
    cursor: pointer;
}

.ts-tc__btn--ghost {
    color: var(--ts-tc-fg);
    background: transparent;
    border-color: var(--ts-tc-border);
}

.ts-tc__btn:focus-visible,
.ts-tc-reopen:focus-visible,
.ts-tc__pref input:focus-visible {
    outline: 2px solid var(--ts-tc-accent);
    outline-offset: 2px;
}

.ts-tc-reopen {
    position: fixed;
    z-index: 2147482999;
    left: 16px;
    bottom: 16px;
    padding: 8px 14px;
    font-family: var(--ts-tc-font);
    font-size: 13px;
    color: var(--ts-tc-fg);
    background: var(--ts-tc-bg);
    border: 1px solid var(--ts-tc-border);
    border-radius: 999px;
    box-shadow: 0 4px 16px rgb(0 0 0 / 0.12);
    cursor: pointer;
}

@media (max-width: 520px) {
    .ts-tc {
        inset: auto 8px 8px 8px;
    }

    .ts-tc__box {
        padding: 18px;
    }

    .ts-tc__btn {
        flex-basis: 100%;
    }
}
