.rs-page, .rs-screen {
    color: var(--rs-text);
}

.rs-screen {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.rs-screen-header {
    min-height: var(--rs-page-header-height);
    padding: 6px 16px;
    display: flex;
    flex: 0 0 var(--rs-page-header-height);
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--rs-surface-panel);
    border-bottom: 1px solid var(--rs-border-subtle);
}

.rs-screen-header__main, .rs-header-main {
    display: flex;
    align-items: center;
    min-width: 0;
}

.rs-screen-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--rs-text);
    font-size: 17px;
    line-height: 1.25;
    font-weight: 600;
}

.rs-screen-state {
    flex: 1 1 auto;
}

.rs-screen-surface {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: var(--rs-surface-panel);
}

.rs-screen--list-pattern, .rs-screen--form-pattern {
    padding: 12px 16px;
    overflow: hidden;
}

.rs-screen--list-pattern > .rs-page-panel, .rs-screen--form-pattern .rs-page-panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    min-height: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.rs-screen--list-pattern .rs-page-header, .rs-screen--form-pattern .rs-page-header {
    background: var(--rs-surface-panel);
    border-color: var(--rs-border-subtle);
}

.rs-screen--list-pattern > :is(.rs-screen-surface, .rs-page-panel) > .rs-panel-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.rs-screen--form-pattern form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.rs-screen--form-pattern form > .rs-panel-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 12px 16px;
    overflow: auto;
}

.rs-page-panel, .rs-panel {
    background: var(--rs-surface-panel);
    border: 1px solid var(--rs-border);
    border-radius: var(--rs-radius-md);
    box-shadow: var(--rs-shadow-sm);
}

.rs-page-header {
    min-height: var(--rs-page-header-height);
    padding: 6px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--rs-surface-header);
    border-bottom: 1px solid var(--rs-border);
}

.rs-page-title {
    margin: 0;
    color: var(--rs-text);
    font-size: 17px;
    line-height: 1.25;
    font-weight: 600;
}

.rs-header-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1 1 auto;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.rs-panel-header {
    min-height: var(--rs-panel-header-height);
    padding: 5px 10px;
    display: flex;
    align-items: center;
    background: var(--rs-surface-header);
    border-bottom: 1px solid var(--rs-border);
}

.rs-panel-header :is(h1, h2, h3, h4, h5, h6) {
    margin: 0;
    color: var(--rs-text);
    font-size: 15px;
    line-height: 1.25;
    font-weight: 600;
}

.rs-panel-body {
    padding: 12px;
}

.rs-action-bar, .rs-toolbar, .rs-filter-bar, .rs-row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.rs-row-actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.rs-row-actions .btn {
    box-sizing: border-box;
    flex: 0 0 auto;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 4px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: var(--rs-neutral-action-ink);
    border: 1px solid var(--rs-neutral-action-border);
    border-radius: var(--rs-radius-md);
    background: var(--rs-neutral-action-surface);
    font-size: 13px;
    font-weight: 500;
    line-height: 20px;
    box-shadow: none;
}

.rs-row-actions.btn-group > .btn {
    flex: 0 0 auto;
    margin-left: 0 !important;
    border-radius: var(--rs-radius-md) !important;
}

.rs-row-actions .btn:hover:not(:disabled) {
    color: var(--rs-neutral-action-hover-ink);
    border-color: var(--rs-neutral-action-hover-border);
    background: var(--rs-neutral-action-hover-surface);
}

.rs-row-actions .btn:focus-visible {
    color: var(--rs-neutral-action-ink);
    border-color: var(--rs-neutral-action-border);
    background: var(--rs-neutral-action-surface);
    outline: var(--rs-focus-outline);
    outline-offset: 2px;
    box-shadow: none;
}

.rs-row-actions .rs-icon-button {
    flex: 0 0 30px;
    width: 30px;
    min-width: 30px;
    max-width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0;
    color: var(--rs-neutral-action-icon);
    border-color: var(--rs-neutral-action-border);
    background: var(--rs-neutral-action-surface);
}

.rs-row-actions .btn .bi {
    font-size: 14px;
    line-height: 1;
}

.rs-row-actions .rs-icon-button:focus-visible {
    color: var(--rs-neutral-action-icon);
    border-color: var(--rs-neutral-action-border);
    background: var(--rs-neutral-action-surface);
    outline: var(--rs-focus-outline);
    outline-offset: 2px;
    box-shadow: none;
}

.rs-row-actions .rs-icon-button:disabled {
    color: var(--rs-neutral-action-disabled-ink);
    border-color: var(--rs-neutral-action-disabled-border);
    background: var(--rs-neutral-action-disabled-surface);
    opacity: 1;
}

.rs-row-actions .rs-row-action--destructive {
    color: var(--rs-error);
    border-color: var(--rs-destructive-action-border);
    background: var(--rs-surface-panel);
}

.rs-row-actions .rs-row-action--destructive:hover:not(:disabled) {
    color: var(--rs-error);
    border-color: var(--rs-error);
    background: var(--rs-destructive-action-hover-surface);
}

.rs-row-actions .rs-row-action--destructive:focus-visible {
    color: var(--rs-error);
    border-color: var(--rs-error);
    background: var(--rs-surface-panel);
    outline: var(--rs-focus-outline);
    outline-offset: 2px;
}

.rs-icon-button {
    width: var(--rs-control-height);
    height: var(--rs-control-height);
    padding: 0;
    display: inline-grid;
    place-items: center;
}

.rs-search {
    position: relative;
}

.rs-search > .bi-search, .rs-search > [class*="bi-search"] {
    position: absolute;
    left: 10px;
    top: 50%;
    translate: 0 -50%;
    color: var(--rs-text-muted);
    pointer-events: none;
}

.rs-search > .form-control {
    padding-left: 32px;
}

.rs-search-clear {
    display: inline-grid;
    width: 28px;
    height: 28px;
    padding: 0;
    place-items: center;
    color: var(--rs-text-muted);
    background: transparent;
    border: 0;
    border-radius: var(--rs-radius-sm);
}

.rs-search-clear:hover:not(:disabled), .rs-search-clear:focus-visible {
    color: var(--rs-text);
    background: var(--rs-surface-subtle);
}

.rs-search-clear:focus-visible {
    outline: var(--rs-focus-outline);
    outline-offset: 1px;
}

.rs-segmented {
    min-height: var(--rs-control-height);
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--rs-control-frame);
    border-radius: var(--rs-radius-md);
    background: var(--rs-surface-subtle);
}

.rs-segmented > .btn {
    min-height: 28px;
    padding-block: 2px;
    border-color: transparent;
}

.rs-segmented > button:not(:where(.btn)) {
    min-height: 28px;
    color: var(--rs-text-muted);
    background: transparent;
    border: 0;
    border-radius: var(--rs-radius-sm);
    font-size: 12px;
}

.rs-segmented .active, .rs-segmented [aria-pressed="true"], .rs-segmented [aria-selected="true"] {
    color: var(--rs-text);
    border-color: var(--rs-control-frame);
    background: var(--rs-surface-panel);
    box-shadow: var(--rs-shadow-sm);
}

.rs-field-help, .form-text {
    margin-top: 4px;
    color: var(--rs-text-muted);
    font-size: 12px;
    line-height: 1.4;
}

.rs-table {
    margin-bottom: 0;
    color: var(--rs-text);
    background: var(--rs-surface-panel);
    border-color: var(--rs-border-subtle);
    font: var(--rs-type-control);
}

.rs-table > :not(caption) > * > * {
    color: var(--rs-text);
    background-color: var(--rs-surface-panel);
    border-color: var(--rs-border-subtle);
    box-shadow: none;
}

.rs-table .rs-cell-truncate {
    max-width: 400px;
}

.rs-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    height: 36px;
    padding-block: 5px;
    vertical-align: middle;
    background: var(--rs-surface-header);
    color: var(--rs-text);
    font-weight: 650;
}

.rs-table tbody > tr:nth-of-type(odd) > * {
    background: var(--rs-table-stripe);
}

.rs-table tbody > tr:hover > * {
    background: var(--rs-accent-hover-surface);
}

.rs-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border: 1px solid var(--rs-accent-border);
    border-radius: 999px;
    color: var(--rs-accent-ink);
    background: var(--rs-accent-chip);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.rs-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 650;
}

.rs-row-title {
    font: var(--rs-type-row-title);
}

.rs-meta {
    color: var(--rs-text-muted);
    font: var(--rs-type-meta);
}

.rs-star-marker {
    color: var(--rs-warning);
}

.rs-empty-state, .rs-loading-state, .rs-error-state {
    padding: 28px 16px;
    text-align: center;
    color: var(--rs-text-muted);
}

.rs-empty-state__icon {
    font-size: 4rem;
}

.rs-empty-state__title {
    color: var(--rs-text);
    font-size: 15px;
    font-weight: 600;
}

.rs-empty-state__description {
    color: var(--rs-text-muted);
    font-size: 13px;
}

.rs-empty-state--spacious {
    padding: 3rem 0;
}

.rs-error-state {
    color: var(--rs-error);
}

.rs-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--rs-text-muted);
}

.rs-review-warning {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    min-width: 0;
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid var(--rs-alert-warning-border);
    border-left-width: 3px;
    border-radius: var(--rs-radius-md);
    background: var(--rs-alert-warning-surface);
    color: var(--rs-text);
}

.rs-review-warning__icon {
    color: var(--rs-tone);
    font-size: 24px;
    line-height: 1;
}

.rs-review-warning__content {
    display: grid;
    min-width: 0;
    gap: 2px;
    overflow-wrap: anywhere;
    font-size: 14px;
    line-height: 1.4;
}

.rs-review-warning__content strong {
    font-size: 16px;
    font-weight: 600;
}

.rs-review-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border: 1px solid var(--rs-alert-warning-border);
    border-radius: 999px;
    background: var(--rs-alert-warning-surface);
    color: var(--rs-tone);
    font-size: 12px;
    line-height: 18px;
    white-space: nowrap;
}

[data-rs-tone="neutral"], [data-rs-status="pending"] {
    --rs-tone: var(--rs-text-muted);
    --rs-tone-fill: var(--rs-surface-subtle);
}

[data-rs-tone="accent"], [data-rs-tone="confirmation"] {
    --rs-tone: var(--rs-accent);
    --rs-tone-fill: var(--rs-accent-fill);
}

[data-rs-tone="success"], [data-rs-status="completed"] {
    --rs-tone: var(--rs-success);
}

[data-rs-tone="warning"] {
    --rs-tone: var(--rs-warning);
}

[data-rs-tone="error"], [data-rs-status="failed"] {
    --rs-tone: var(--rs-error);
}

[data-rs-tone="info"], [data-rs-status="processing"] {
    --rs-tone: var(--rs-info);
}

[data-rs-tone="editor"] {
    --rs-tone: var(--rs-editor);
}

[data-rs-tone="organ"] {
    --rs-tone: var(--rs-organ);
}

[data-rs-status="pending"] {
    --rs-status-row-surface: var(--rs-status-pending-row-surface);
    --rs-status-row-border: var(--rs-status-pending-row-border);
}

[data-rs-status="processing"] {
    --rs-status-row-surface: var(--rs-status-processing-row-surface);
    --rs-status-row-border: var(--rs-status-processing-row-border);
}

[data-rs-status="completed"] {
    --rs-status-row-surface: var(--rs-status-completed-row-surface);
    --rs-status-row-border: var(--rs-status-completed-row-border);
}

[data-rs-status="failed"] {
    --rs-status-row-surface: var(--rs-status-failed-row-surface);
    --rs-status-row-border: var(--rs-status-failed-row-border);
}

.rs-badge[data-rs-tone], .rs-badge[data-rs-status] {
    color: var(--rs-on-accent);
    background: var(--rs-tone);
}

.rs-status[data-rs-tone], .rs-status[data-rs-status] {
    color: var(--rs-tone);
}

.rs-table tr[data-rs-status] > td {
    background: var(--rs-status-row-surface);
    border-color: var(--rs-status-row-border);
}

.rs-table tr[data-rs-status="processing"] > td:first-child {
    box-shadow: inset 3px 0 var(--rs-info);
}

.rs-table tr[data-rs-status="completed"] > td:first-child {
    box-shadow: inset 3px 0 var(--rs-success);
}

.rs-table tr[data-rs-status="failed"] > td:first-child {
    box-shadow: inset 3px 0 var(--rs-error);
}

.rs-table tr[data-rs-status="pending"] > td:first-child {
    box-shadow: inset 3px 0 var(--rs-text-muted);
}

.rs-table tbody > tr[aria-selected="true"] > * {
    color: var(--rs-text);
    background: var(--rs-accent-chip);
}

mark, .search-highlight, .sentence-library-highlight, .mention-parameter {
    color: var(--rs-text);
    background: var(--rs-search-hit);
}

.rs-sentence-preview {
    min-width: 0;
    color: var(--rs-text-secondary);
    font: var(--rs-type-sentence-preview);
}

.rs-settings-surface {
    background: var(--rs-surface-subtle);
}

.rs-screen--edge-to-edge {
    padding: 0;
    overflow: hidden;
    background: var(--rs-surface-page);
}

.rs-screen--edge-to-edge > :is(.rs-screen-surface, .rs-page-panel) {
    width: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.rs-screen--edge-to-edge > :is(.rs-screen-surface, .rs-page-panel) > .rs-page-header {
    padding-inline: 16px;
    background: var(--rs-surface-panel);
    border-color: var(--rs-border-subtle);
}

.rs-screen--edge-to-edge > :is(.rs-screen-surface, .rs-page-panel) > .rs-panel-body {
    padding: 12px 16px;
}

.rs-pagination {
    display: flex;
    gap: 4px;
    margin: 0;
}

.rs-pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 3px 8px;
    color: var(--rs-text);
    background: var(--rs-surface-panel);
    border: 1px solid var(--rs-control-frame);
    border-radius: var(--rs-radius-sm);
    font-size: 13px;
    line-height: 20px;
    box-shadow: none;
}

.rs-pagination .page-link:hover:not(:disabled) {
    color: var(--rs-text);
    background: var(--rs-accent-chip);
    border-color: var(--rs-accent);
}

.rs-pagination .page-link:focus-visible {
    outline: var(--rs-focus-outline);
    outline-offset: 1px;
    box-shadow: none;
}

.rs-pagination .page-item.active .page-link {
    color: var(--rs-on-accent);
    background: var(--rs-accent);
    border-color: var(--rs-accent);
}

.rs-pagination .page-item.disabled .page-link, .rs-pagination .page-link:disabled {
    color: var(--rs-text-muted);
    background: var(--rs-surface-subtle);
    border-color: var(--rs-border);
    opacity: .65;
}

@media (max-width: 768px) {
    .rs-screen--edge-to-edge {
        padding: 8px;
        overflow: auto;
    }
}
