.webcasteller-embed {
    --wc-red: #b51f2e;
    --wc-border: #d9d9de;
    margin: 24px 0;
    padding: 18px;
    border: 1px solid var(--wc-border);
    border-radius: 10px;
    background: #fff;
    color: #202124;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.webcasteller-embed-header,
.webcasteller-embed-form,
.webcasteller-embed-diada > header,
.webcasteller-embed-pagination {
    display: flex;
    gap: 10px;
    align-items: center;
}

.webcasteller-embed-header {
    justify-content: space-between;
    align-items: flex-start;
}

.webcasteller-embed-header h2,
.webcasteller-embed-header p {
    margin: 0;
}

.webcasteller-embed-header p,
.webcasteller-embed-meta,
.webcasteller-embed-message,
.webcasteller-embed-source {
    color: #666;
    font-size: 0.9em;
}

.webcasteller-embed-scope-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    margin-top: 4px;
}

.webcasteller-embed-scope-switch {
    display: inline-flex;
    padding: 2px;
    border: 1px solid var(--wc-border);
    border-radius: 999px;
    background: #f6f7f7;
}

.webcasteller-embed .webcasteller-embed-scope-switch button {
    min-height: 30px;
    padding: 4px 10px;
    border-radius: 999px;
    background: transparent;
    color: #50545a;
    font-size: 12px;
    font-weight: 700;
}

.webcasteller-embed .webcasteller-embed-scope-switch button.is-active {
    background: var(--wc-red);
    color: #fff;
}

.webcasteller-embed .webcasteller-embed-scope-switch button:disabled {
    color: #777;
    opacity: 0.58;
}

.webcasteller-embed-scope-switch small {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.webcasteller-embed-readonly {
    padding: 4px 9px;
    border-radius: 999px;
    background: #edf7ed;
    color: #176b2c;
    font-size: 12px;
    font-weight: 700;
}

.webcasteller-embed-form {
    margin-top: 14px;
}

.webcasteller-embed-form label {
    flex: 1;
}

.webcasteller-embed-form input[type="search"] {
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid #9ca0a6;
    border-radius: 6px;
    font: inherit;
}

.webcasteller-embed button {
    min-height: 42px;
    padding: 7px 15px;
    border: 0;
    border-radius: 6px;
    background: var(--wc-red);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.webcasteller-embed button:disabled {
    cursor: default;
    opacity: 0.45;
}

.webcasteller-embed-message {
    min-height: 1.4em;
    margin: 12px 0 0;
}

.webcasteller-embed-message.is-error,
.webcasteller-embed-notice.is-error {
    color: #a61b29;
}

.webcasteller-embed-diada {
    margin-top: 14px;
    padding: 13px 0 4px;
    border-top: 1px solid var(--wc-border);
}

.webcasteller-embed-diada > header {
    flex-wrap: wrap;
}

.webcasteller-embed-diada time {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.webcasteller-embed-diada > header small {
    color: #777;
}

.webcasteller-embed-meta {
    margin: 3px 0 9px;
}

.webcasteller-embed-actuacio {
    display: grid;
    grid-template-columns: minmax(180px, 30%) 1fr;
    gap: 8px;
    padding: 3px 0;
}

.webcasteller-embed-castell {
    display: inline-block;
    margin-right: 8px;
}

.webcasteller-embed-castell.is-match,
.webcasteller-embed-colla.is-match {
    padding: 0 3px;
    border-radius: 3px;
    background: #fff08a;
    font-weight: 700;
}

.webcasteller-embed-statistics {
    margin-top: 14px;
    overflow-x: auto;
}

.webcasteller-embed-colla-statistics + .webcasteller-embed-colla-statistics {
    margin-top: 1.5rem;
}

.webcasteller-embed-colla-statistics h3 {
    margin: 0 0 .55rem;
    font-size: 1.05rem;
}

.webcasteller-embed-colla-statistics h3 span {
    font-weight: 600;
}

.webcasteller-embed-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.webcasteller-embed-table th,
.webcasteller-embed-table td {
    padding: 8px 10px;
    border: 1px solid var(--wc-border);
    text-align: center;
}

.webcasteller-embed-table th:first-child {
    text-align: left;
}

.webcasteller-embed-table thead,
.webcasteller-embed-table tfoot {
    background: #f6f7f7;
    font-weight: 700;
}

.webcasteller-embed-pagination {
    justify-content: center;
    margin-top: 18px;
}

.webcasteller-embed-source {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    justify-content: space-between;
    text-align: right;
}

.webcasteller-embed-feedback button {
    min-height: auto;
    margin-left: 4px;
    padding: 3px 8px;
    border: 1px solid #a7aaad;
    background: #fff;
    color: #3c434a;
    font-size: 12px;
    font-weight: 600;
}

.webcasteller-embed-notice {
    margin: 18px 0;
    padding: 12px;
    border-left: 4px solid #777;
    background: #f6f7f7;
}

@media (max-width: 640px) {
    .webcasteller-embed-form,
    .webcasteller-embed-actuacio {
        display: block;
    }

    .webcasteller-embed-form button {
        width: 100%;
        margin-top: 8px;
    }

    .webcasteller-embed-actuacio > div {
        margin-top: 2px;
    }

    .webcasteller-embed-header {
        flex-wrap: wrap;
    }
}
