/* Activity page: toolbar, loading rows, sender groups. Row styles live in modern.css. */

/* One line: search grows, the two selects stay compact beside it. */
.activity-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.activity-toolbar #activity-search {
    flex: 1 1 16rem;
    width: auto;
    min-width: 0;
    min-height: 2.25rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

.activity-toolbar select {
    flex: 0 0 auto;
    width: auto;
    min-height: 2.25rem;
    padding: 0.4rem 0.7rem;
    font-size: 0.8125rem;
    cursor: pointer;
}

@media (max-width: 560px) {
    /* Phone: search on its own line, the two selects share the next one. */
    .activity-toolbar #activity-search {
        flex-basis: 100%;
    }

    .activity-toolbar select {
        flex: 1 1 0;
        min-width: 0;
    }
}

/* Loading rows, same skeleton grammar as the Rules page. */
.activity-skeleton-heading {
    width: 4.5rem;
    height: 0.75rem;
    margin: 0.65rem 0 0.6rem;
    border-radius: var(--radius-sm);
}

.activity-skeleton-row {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--line);
}

.activity-skeleton-line {
    height: 0.8rem;
    width: 72%;
    border-radius: var(--radius-sm);
}

.activity-skeleton-line.short {
    width: 44%;
    height: 0.65rem;
    margin-top: 0.45rem;
}

.activity-skeleton-row:nth-child(3n) .activity-skeleton-line:not(.short) {
    width: 58%;
}

.activity-skeleton-row:nth-child(3n + 1) .activity-skeleton-line:not(.short) {
    width: 80%;
}

/* The loaded span reads as a footnote under the list, never a heading. */
.activity-range {
    margin: 0.75rem 0 0;
    text-align: center;
    color: var(--text-faint);
    font-size: 0.75rem;
}

/* Sender groups: one summary row that opens to the individual rows. */
button.activity-group-summary {
    width: 100%;
    padding: 0.55rem 0;
    border: none;
    border-bottom: 1px solid var(--rule);
    border-radius: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 400;
    letter-spacing: normal;
    text-align: left;
    justify-content: stretch;
    align-items: start;
    gap: 0;
    column-gap: 0.65rem;
    transform: none;
}

button.activity-group-summary:hover {
    background: var(--bg-card-hover);
    transform: none;
}

button.activity-group-summary:active {
    transform: none;
}

button.activity-group-summary:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: -2px;
}

/* Spans inside a button: give main its block box (chrome and controls are flex already). */
.activity-group-summary .activity-row-main {
    display: block;
}

.activity-group-count {
    flex: none;
    min-width: 1.4rem;
    padding: 0 0.4rem;
    border-radius: var(--radius-pill);
    background: var(--bg-card-3);
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.35rem;
    text-align: center;
}

.activity-group-chevron {
    display: inline-flex;
    align-self: center;
    color: var(--text-faint);
    transition: transform 0.15s;
}

.activity-group-summary[aria-expanded="true"] .activity-group-chevron {
    transform: rotate(180deg);
}

/* Opened rows sit indented under their summary. */
.activity-group-items {
    padding-left: 1rem;
    border-left: 2px solid var(--line);
    margin-left: 0.25rem;
}

@media (prefers-reduced-motion: reduce) {
    .activity-group-chevron {
        transition: none;
    }
}
