/* The review workspace owns its width; the document owns vertical scrolling. */
.watch-entries-review-table,
.watch-entries-review-table .fi-ta-ctn,
.watch-entries-review-table .fi-ta-main,
.watch-entries-review-table .fi-ta-header-ctn,
.watch-entries-review-table .fi-ta-filters-above-content-ctn,
.watch-entries-review-table .fi-ta-filters,
.watch-entries-review-table .fi-ta-content-ctn,
.watch-entries-review-table .fi-pagination {
    width: 100%;
    max-width: none;
    min-width: 0;
}

.watch-entries-review-table .fi-ta-ctn {
    overflow: visible !important;
}

.watch-entries-review-table .fi-ta-content-ctn {
    max-height: none !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
}

.watch-entries-review-table .fi-ta-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.watch-entries-review-table .fi-ta-table th,
.watch-entries-review-table .fi-ta-table td,
.watch-entries-review-table .fi-ta-cell-content,
.watch-entries-review-table [data-field-wrapper],
.watch-entries-review-table .fi-sc-section,
.watch-entries-review-table .fi-section {
    min-width: 0;
}

.watch-entries-review-table .fi-ta-table tbody {
    white-space: normal;
}

.watch-entries-review-table .fi-ta-cell-content,
.watch-entries-review-table .fi-ta-cell-title,
.watch-entries-review-table .fi-ta-cell-company-name,
.watch-entries-review-table .fi-ta-cell-source-urls {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.watch-entries-review-table .fi-ta-header-toolbar {
    align-items: flex-start;
    gap: 0.75rem 1rem;
}

.watch-entries-review-table .fi-ta-header-toolbar > * {
    min-width: 0;
    flex-wrap: wrap;
}

.watch-entries-review-table .fi-ta-header-toolbar > :nth-child(2) {
    flex: 1 1 24rem;
    justify-content: flex-end;
}

.watch-entries-review-table .fi-ta-search-field {
    width: min(100%, 28rem);
    min-width: 14rem;
    flex: 1 1 18rem;
}

.watch-entries-review-table .fi-ta-filters-above-content-ctn {
    display: block;
    padding-block: 1rem;
}

/* The Watch Entries filter form supplies its own accessible collapsible panel. */
.watch-entries-review-table .fi-ta-filters > .fi-ta-filters-header {
    display: none;
}

.watch-entries-review-table .watch-entries-filters-panel {
    width: 100%;
}

.watch-entries-review-table .watch-entries-filters-panel .fi-section-header {
    cursor: pointer;
}

.watch-entries-review-table .watch-entries-filters-panel .fi-section-header-description {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.watch-entries-review-table .watch-entries-filters-panel .fi-section-header-after-ctn {
    margin-inline-start: auto;
}

.watch-entries-review-table .fi-ta-filters > .fi-sc {
    width: 100%;
    min-width: 0;
    gap: 1rem;
}

.watch-entries-review-table .fi-ta-filters .fi-sc-section,
.watch-entries-review-table .fi-ta-filters .fi-section-content,
.watch-entries-review-table .fi-ta-filters .fi-sc {
    min-width: 0;
}

.watch-entries-review-table .fi-ta-filters .fi-fo-toggle-buttons {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.watch-entries-review-table .fi-ta-filters .fi-fo-toggle-buttons .fi-btn {
    min-width: max-content;
    white-space: nowrap;
}

.watch-entries-review-table .fi-ta-filters [data-field-wrapper] {
    width: 100%;
}

.watch-entries-review-table .fi-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
}

.watch-entries-review-table .fi-pagination-overview {
    display: block !important;
    order: 1;
    flex: 0 1 auto;
    white-space: nowrap;
}

.watch-entries-review-table .fi-pagination-records-per-page-select-ctn {
    display: none;
    order: 2;
    margin: 0;
}

.watch-entries-review-table .fi-pagination-records-per-page-select:not(.fi-compact) {
    display: flex !important;
    order: 2;
}

.watch-entries-review-table .fi-pagination-previous-btn,
.watch-entries-review-table .fi-pagination-next-btn {
    display: none;
}

.watch-entries-review-table .fi-pagination-items {
    display: flex !important;
    order: 3;
    flex: 0 0 auto;
}

.watch-entries-summary {
    border-bottom: 1px solid color-mix(in srgb, var(--gray-200) 100%, transparent);
    background: var(--color-white);
    padding: 1rem 1.5rem;
}

.watch-entries-summary-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.75rem;
}

.watch-entries-summary-card {
    min-width: 0;
    border: 1px solid color-mix(in srgb, var(--gray-200) 100%, transparent);
    border-radius: 0.75rem;
    background: color-mix(in srgb, var(--gray-50) 70%, transparent);
    padding: 0.7rem 0.85rem;
}

.watch-entries-summary-label {
    display: block;
    color: var(--gray-600);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25;
}

.watch-entries-summary-value {
    display: block;
    margin-top: 0.2rem;
    color: var(--gray-950);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.25;
}

.watch-entries-summary-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

.dark .watch-entries-summary {
    border-color: color-mix(in srgb, var(--color-white) 10%, transparent);
    background: var(--gray-900);
}

.dark .watch-entries-summary-card {
    border-color: color-mix(in srgb, var(--color-white) 10%, transparent);
    background: color-mix(in srgb, var(--color-white) 5%, transparent);
}

.dark .watch-entries-summary-label {
    color: var(--gray-300);
}

.dark .watch-entries-summary-value {
    color: var(--color-white);
}

@media (min-width: 64rem) {
    .fi-body-has-sidebar-collapsible-on-desktop .fi-sidebar:not(.fi-sidebar-open) {
        width: var(--collapsed-sidebar-width);
    }

    .fi-body-has-sidebar-collapsible-on-desktop .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-header {
        padding-inline: 0.5rem;
    }
}

@media (max-width: 63.99rem) {
    .watch-entries-review-table .fi-ta-content-ctn {
        overflow-x: auto !important;
    }

    .watch-entries-review-table .fi-ta-table {
        min-width: 54rem;
        table-layout: auto;
    }

    .watch-entries-review-table .fi-pagination-records-per-page-select-ctn {
        display: block;
    }

    .watch-entries-review-table .fi-pagination-records-per-page-select:not(.fi-compact) {
        display: none !important;
    }

    .watch-entries-review-table .fi-pagination-overview {
        flex: 1 0 100%;
    }

    .watch-entries-review-table .fi-ta-header-toolbar > :nth-child(2),
    .watch-entries-review-table .fi-ta-search-field {
        width: 100%;
        min-width: 0;
        flex-basis: 100%;
    }
}

@media (max-width: 79.99rem) {
    .watch-entries-summary-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 39.99rem) {
    .watch-entries-summary {
        padding-inline: 1rem;
    }

    .watch-entries-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .watch-entries-review-table .fi-pagination {
        align-items: flex-start;
    }

    .watch-entries-review-table .fi-pagination-items {
        max-width: 100%;
        overflow-x: auto;
    }
}

@media (max-width: 24rem) {
    .watch-entries-summary-grid {
        grid-template-columns: 1fr;
    }
}

.watch-dashboard-shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin-bottom: 1.5rem; }
.watch-dashboard-button { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .6rem; min-height: 10rem; padding: 2rem; border-radius: 1rem; background: #b91c1c; color: #fff !important; text-align: center; text-decoration: none; box-shadow: 0 4px 12px #0002; }
.watch-dashboard-button strong { font-size: 1.75rem; font-weight: 800; letter-spacing: .04em; }
.watch-dashboard-button span { font-size: 1rem; }
.watch-dashboard-button:hover { background: #991b1b; }
.watch-dashboard-button:focus-visible { outline: 3px solid #0284c7; outline-offset: 4px; }
@media (max-width: 39.99rem) { .watch-dashboard-shortcuts { grid-template-columns: 1fr; gap: 1rem; } .watch-dashboard-button { min-height: 8rem; } }

.watch-entries-trash-summary .watch-entries-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 48rem;
}

.watch-entries-trash-summary-note {
    margin-top: 0.75rem;
    color: var(--gray-600);
    font-size: 0.8rem;
    line-height: 1.4;
}

.dark .watch-entries-trash-summary-note {
    color: var(--gray-300);
}

@media (max-width: 39.99rem) {
    .watch-entries-trash-summary .watch-entries-summary-grid {
        grid-template-columns: 1fr;
    }
}


/* Weekly reports are kept together in expandable, color-banded week sections. */
.weekly-digests-review-table .fi-ta-group-header {
    margin: 0.85rem 0.5rem 0.25rem;
    border: 1px solid transparent;
    border-radius: 0.85rem;
    box-shadow: 0 3px 10px rgb(15 23 42 / 0.12);
    color: #0f172a;
    transition: filter 120ms ease, transform 120ms ease;
}

.weekly-digests-review-table .fi-ta-group-header.fi-collapsible:hover {
    filter: brightness(0.97);
}

.weekly-digests-review-table .fi-ta-group-header:has(+ .fi-ta-record.weekly-digest-week-tone-0) {
    border-color: #86efac;
    background: #dcfce7;
    color: #14532d;
}

.weekly-digests-review-table .fi-ta-group-header:has(+ .fi-ta-record.weekly-digest-week-tone-1) {
    border-color: #d8b4fe;
    background: #f3e8ff;
    color: #6b21a8;
}

.weekly-digests-review-table .fi-ta-group-header:has(+ .fi-ta-record.weekly-digest-week-tone-2) {
    border-color: #93c5fd;
    background: #dbeafe;
    color: #1e3a8a;
}

.weekly-digests-review-table .fi-ta-group-header:has(+ .fi-ta-record.weekly-digest-week-tone-3) {
    border-color: #cbd5e1;
    background: #e2e8f0;
    color: #334155;
}

.weekly-digests-review-table .fi-ta-group-header button,
.weekly-digests-review-table .fi-ta-group-header a,
.weekly-digests-review-table .fi-ta-group-header svg,
.weekly-digests-review-table .fi-ta-group-heading,
.weekly-digests-review-table .fi-ta-group-description {
    color: inherit;
}

.weekly-digests-review-table .fi-ta-record[class*="weekly-digest-week-tone-"] {
    border-inline-start: 4px solid transparent;
}

.weekly-digests-review-table .fi-ta-record.weekly-digest-week-tone-0 {
    border-inline-start-color: #22c55e;
    background: rgb(34 197 94 / 0.045);
}

.weekly-digests-review-table .fi-ta-record.weekly-digest-week-tone-1 {
    border-inline-start-color: #a855f7;
    background: rgb(168 85 247 / 0.045);
}

.weekly-digests-review-table .fi-ta-record.weekly-digest-week-tone-2 {
    border-inline-start-color: #3b82f6;
    background: rgb(59 130 246 / 0.045);
}

.weekly-digests-review-table .fi-ta-record.weekly-digest-week-tone-3 {
    border-inline-start-color: #64748b;
    background: rgb(100 116 139 / 0.05);
}

.dark .weekly-digests-review-table .fi-ta-group-header:has(+ .fi-ta-record.weekly-digest-week-tone-0) {
    border-color: #166534;
    background: #052e16;
    color: #bbf7d0;
}

.dark .weekly-digests-review-table .fi-ta-group-header:has(+ .fi-ta-record.weekly-digest-week-tone-1) {
    border-color: #7e22ce;
    background: #3b0764;
    color: #e9d5ff;
}

.dark .weekly-digests-review-table .fi-ta-group-header:has(+ .fi-ta-record.weekly-digest-week-tone-2) {
    border-color: #1d4ed8;
    background: #172554;
    color: #dbeafe;
}

.dark .weekly-digests-review-table .fi-ta-group-header:has(+ .fi-ta-record.weekly-digest-week-tone-3) {
    border-color: #475569;
    background: #1e293b;
    color: #e2e8f0;
}

.dark .weekly-digests-review-table .fi-ta-record.weekly-digest-week-tone-0 {
    background: rgb(34 197 94 / 0.08);
}

.dark .weekly-digests-review-table .fi-ta-record.weekly-digest-week-tone-1 {
    background: rgb(168 85 247 / 0.08);
}

.dark .weekly-digests-review-table .fi-ta-record.weekly-digest-week-tone-2 {
    background: rgb(59 130 246 / 0.08);
}

.dark .weekly-digests-review-table .fi-ta-record.weekly-digest-week-tone-3 {
    background: rgb(100 116 139 / 0.09);
}
