.tdb-dashboard {
    color: #17202a;
    font-family: inherit;
}

.tdb-modal-open {
    overflow: hidden;
}

.tdb-dashboard *,
.tdb-dashboard *::before,
.tdb-dashboard *::after {
    box-sizing: border-box;
}

.tdb-sr-only {
    border: 0;
    clip: rect(0, 0, 0, 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}

.tdb-filters {
    align-items: end;
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(22, 32, 42, 0.08);
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(240px, 1.4fr) minmax(220px, 1.1fr) repeat(3, minmax(140px, 1fr));
    margin-bottom: 18px;
    padding: 14px;
}

.tdb-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.tdb-field span {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 750;
}

.tdb-field input,
.tdb-field select {
    background: #fbfdff;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    box-shadow: none;
    color: #17202a;
    font: inherit;
    min-height: 42px;
    min-width: 0;
    outline: 0;
    padding: 8px 10px;
    width: 100%;
}

.tdb-field input:focus,
.tdb-field select:focus {
    border-color: #147253;
    box-shadow: 0 0 0 3px rgba(20, 114, 83, 0.14);
}

.tdb-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
}

.tdb-card {
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(22, 32, 42, 0.05);
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 390px;
    padding: 16px;
    container-type: inline-size;
}

.tdb-card[hidden] {
    display: none;
}

.tdb-card__topline {
    align-items: center;
    color: #64748b;
    display: flex;
    font-size: 0.86rem;
    gap: 10px;
    justify-content: space-between;
    line-height: 1.3;
}

.tdb-card h3 {
    color: #17202a;
    display: -webkit-box;
    font-size: 1.05rem;
    height: 2.6em;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    letter-spacing: 0;
    line-height: 1.3;
    margin: 0;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.tdb-pill {
    background: #eef2ff;
    border: 1px solid #d7defe;
    border-radius: 999px;
    color: #3348a4;
    flex: 0 0 auto;
    font-size: 0.74rem;
    font-weight: 800;
    max-width: 46%;
    overflow: hidden;
    padding: 4px 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tdb-people-dropdown {
    background: #fbfdff;
    border: 1px solid #e8edf3;
    border-radius: 8px;
}

.tdb-people-summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    list-style: none;
    min-height: 42px;
    padding: 9px 10px;
}

.tdb-people-summary::-webkit-details-marker {
    display: none;
}

.tdb-people-summary::after {
    border-bottom: 2px solid #64748b;
    border-right: 2px solid #64748b;
    content: "";
    flex: 0 0 auto;
    height: 8px;
    margin-left: 4px;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.16s ease;
    width: 8px;
}

.tdb-people-dropdown[open] .tdb-people-summary::after {
    transform: rotate(225deg) translateY(-2px);
}

.tdb-people-summary__label {
    color: #17202a;
    font-size: 0.9rem;
    font-weight: 780;
}

.tdb-people-summary__count {
    color: #64748b;
    font-size: 0.82rem;
    margin-left: auto;
}

.tdb-people {
    border-top: 1px solid #e8edf3;
    display: grid;
    gap: 6px;
    max-height: 240px;
    min-width: 0;
    overflow: auto;
    padding: 8px;
}

.tdb-person {
    background: #f8fafc;
    border: 1px solid #e8edf3;
    border-radius: 8px;
    display: grid;
    min-width: 0;
    padding: 9px 10px;
}

.tdb-person__email {
    color: #0f766e;
    font-size: 0.83rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
    text-decoration: none;
}

.tdb-person__email:hover {
    text-decoration: underline;
}

.tdb-person__email--missing {
    color: #8492a6;
}

.tdb-meta {
    color: #64748b;
    display: flex;
    flex-wrap: wrap;
    font-size: 0.82rem;
    gap: 6px;
    margin-top: auto;
}

.tdb-meta span {
    background: #f8fafc;
    border: 1px solid #e8edf3;
    border-radius: 999px;
    max-width: 100%;
    overflow-wrap: anywhere;
    padding: 4px 8px;
}

.tdb-card__footer {
    display: grid;
    gap: 9px;
}

.tdb-transcript-snippet {
    color: #64748b;
    display: -webkit-box;
    font-size: 0.86rem;
    height: 5.8em;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-height: 1.45;
    margin: 0;
    overflow: hidden;
}

.tdb-transcript-snippet--missing {
    color: #8492a6;
}

.tdb-actions {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) minmax(122px, 0.48fr);
}

.tdb-actions--has-audio {
    grid-template-columns: minmax(124px, 1fr) minmax(92px, 0.42fr) minmax(72px, 0.32fr);
}

.tdb-open,
.tdb-download,
.tdb-audio {
    align-items: center;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    font-size: 0.9rem;
    font-weight: 750;
    justify-content: center;
    line-height: 1.2;
    min-height: 42px;
    padding: 10px 12px;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    width: 100%;
}

.tdb-open {
    background: #17202a;
    border: 1px solid #17202a;
    color: #ffffff;
}

.tdb-open:hover,
.tdb-open:focus {
    background: #2f3b49;
    color: #ffffff;
}

.tdb-download {
    background: #edf7f1;
    border: 1px solid #cae8d6;
    color: #1b5e3c;
}

.tdb-download:hover,
.tdb-download:focus {
    background: #dff1e8;
    color: #1b5e3c;
    text-decoration: none;
}

.tdb-audio {
    background: #eef2ff;
    border: 1px solid #d7defe;
    color: #3348a4;
}

.tdb-audio:hover,
.tdb-audio:focus {
    background: #e1e8ff;
    color: #3348a4;
    text-decoration: none;
}

.tdb-open:disabled,
.tdb-download--disabled {
    background: #f3f5f7;
    border-color: #d9e2ec;
    color: #6b7785;
    cursor: not-allowed;
}

.tdb-no-results,
.tdb-dashboard--empty {
    background: #fff7e6;
    border: 1px solid #f8d495;
    border-radius: 8px;
    color: #8a560c;
    margin: 12px 0 0;
    padding: 12px 14px;
}

.tdb-transcript-modal[hidden] {
    display: none;
}

.tdb-transcript-modal {
    inset: 0;
    position: fixed;
    z-index: 99999;
}

.tdb-modal-backdrop {
    background: rgba(15, 23, 42, 0.48);
    inset: 0;
    position: absolute;
}

.tdb-transcript-panel {
    background: #ffffff;
    border-radius: 8px 0 0 8px;
    box-shadow: -18px 0 42px rgba(15, 23, 42, 0.2);
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    height: 100%;
    max-width: 880px;
    min-width: min(100%, 420px);
    position: absolute;
    right: 0;
    top: 0;
    width: min(86vw, 880px);
}

.tdb-modal-header {
    align-items: start;
    border-bottom: 1px solid #d9e2ec;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 18px;
}

.tdb-modal-header h2 {
    color: #17202a;
    font-size: 1.25rem;
    letter-spacing: 0;
    line-height: 1.25;
    margin: 2px 0 0;
}

.tdb-modal-meta {
    color: #64748b;
    font-size: 0.84rem;
    margin: 0;
}

.tdb-icon-button {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    color: #17202a;
    cursor: pointer;
    display: inline-flex;
    font-weight: 800;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.tdb-modal-tools {
    align-items: end;
    border-bottom: 1px solid #d9e2ec;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 14px 18px;
}

.tdb-match-count {
    background: #f8fafc;
    border: 1px solid #e8edf3;
    border-radius: 8px;
    color: #64748b;
    min-height: 42px;
    padding: 10px 12px;
    white-space: nowrap;
}

.tdb-transcript-text {
    background: #ffffff;
    color: #17202a;
    font: 0.94rem/1.6 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    margin: 0;
    overflow: auto;
    padding: 18px;
    white-space: pre-wrap;
}

.tdb-transcript-text mark {
    background: #fff0a6;
    border-radius: 4px;
    color: #17202a;
    padding: 0 2px;
}

.tdb-modal-footer {
    border-top: 1px solid #d9e2ec;
    padding: 14px 18px;
}

@media (max-width: 1280px) {
    .tdb-filters {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .tdb-field--wide {
        grid-column: span 2;
    }
}

@media (max-width: 860px) {
    .tdb-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tdb-field--wide {
        grid-column: span 2;
    }
}

@container (max-width: 300px) {
    .tdb-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .tdb-filters {
        grid-template-columns: 1fr;
    }

    .tdb-field--wide {
        grid-column: auto;
    }

    .tdb-transcript-panel {
        border-radius: 0;
        min-width: 0;
        width: 100%;
    }

    .tdb-modal-tools {
        grid-template-columns: 1fr;
    }
}
