.bottom-splitter-collapsed.mud-split-panel>.divider {
    display: none !important;
}

.bottom-splitter-collapsed.mud-split-panel>.child-panel:last-child {
    display: none !important;
}

.bottom-splitter-collapsed.mud-split-panel>.child-panel:first-child {
    flex: 1 1 auto !important;
    max-height: unset !important;
}
.chapter-item-paper {
    background-color: var(--tp-surface-well) !important;
    transition: border-color 0.15s ease;
    min-height: 72px;
}

.chapter-item-desc {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-height: 1.25em;
}

.media-flush {
    --media-frame-border: none;
    --media-frame-radius: 0;
}
.mud-picker-inline-paper {
    border: 1px solid var(--mud-palette-divider) !important;
    border-radius: var(--tp-radius) !important;
    box-shadow: var(--mud-elevation-2) !important;
    background-color: var(--mud-palette-surface) !important;
}

.mud-picker-inline-paper .mud-picker-content {
    padding: var(--tp-space-2) !important;
}

.mud-picker-calendar-header .mud-icon-button,
.mud-picker-calendar-header-switch .mud-icon-button,
.mud-picker-calendar-header-transition + .mud-icon-button {
    background-color: var(--mud-palette-surface) !important;
    border: 1px solid var(--mud-palette-divider) !important;
    color: var(--mud-palette-text-primary) !important;
    border-radius: 50%;
}

.mud-picker-calendar-header .mud-icon-button:hover,
.mud-picker-calendar-header-switch .mud-icon-button:hover {
    background-color: var(--mud-palette-action-default-hover) !important;
    border-color: var(--mud-palette-primary) !important;
    color: var(--mud-palette-primary) !important;
}

.mud-picker-calendar-day.mud-current {
    color: var(--mud-palette-primary) !important;
    border-color: var(--mud-palette-primary) !important;
}

.row-icon {
    font-size: var(--tp-icon-size-xs);
}

/* Admin users, authors & stories tables */
.admin-table-wrapper {
    position: relative;
    overflow-x: auto;
}

/* Skeleton rows render in the table body (LoadingContentBody); suppress MudTable's own
   progress-line row so only the column-title header + skeleton rows show while loading. */
.admin-table-wrapper .mud-table-loading-row {
    display: none;
}

/* Busy state for a reload that keeps what is on screen. MudTable renders LoadingContentBody only for an
   empty table, so a skeleton cannot paint over existing rows; dimming costs one style change and no
   layout, where a per-cell skeleton cost ~200 paint layers per switch. The transition must sit on a class
   the element always carries - declared on the busy class itself it would be removed along with it, and
   the dim would snap back instead of easing. */
.epos-dimmable,
.admin-table-wrapper tbody {
    transition: opacity 0.18s ease-out;
}

.epos-dimmable.epos-refreshing,
.admin-table-wrapper.is-refreshing tbody {
    opacity: 0.45;
}

.admin-sort-header__icon {
    font-size: var(--tp-icon-size-xs) !important;
    color: var(--mud-palette-text-secondary) !important;
    opacity: 0.3;
    transition: opacity 0.15s ease;
}

.admin-sort-header:hover .admin-sort-header__icon {
    opacity: 0.65;
}

/* The active arrow spins into place on each sort click. The header @key's the icon
   on the sort state so it re-mounts and the keyframe replays every time. */
.admin-sort-header--active .admin-sort-header__icon {
    opacity: 1;
    color: var(--mud-palette-text-primary) !important;
    animation: admin-sort-spin 0.3s var(--tp-ease);
}

.admin-sort-header--active .admin-sort-header__icon--desc {
    transform: rotate(180deg);
    animation: admin-sort-spin-desc 0.3s var(--tp-ease);
}

@keyframes admin-sort-spin {
    from {
        transform: rotate(-120deg) scale(0.4);
        opacity: 0.2;
    }
    to {
        transform: rotate(0) scale(1);
        opacity: 1;
    }
}

@keyframes admin-sort-spin-desc {
    from {
        transform: rotate(60deg) scale(0.4);
        opacity: 0.2;
    }
    to {
        transform: rotate(180deg) scale(1);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .admin-sort-header--active .admin-sort-header__icon,
    .admin-sort-header--active .admin-sort-header__icon--desc {
        animation: none;
    }
}

.admin-clickable-table tbody tr {
    cursor: pointer;
}

.redemption-table {
    container-type: inline-size;
}

@container (min-width: 600px) and (max-width: 1699.98px) {
    .redemption-table .mud-table-cell.redemption-col--secondary {
        display: none !important;
    }
}

@container (min-width: 600px) and (max-width: 1399.98px) {
    .redemption-table .mud-table-cell.redemption-col--tertiary {
        display: none !important;
    }
}

@container (min-width: 600px) and (max-width: 1099.98px) {
    .redemption-table .mud-table-cell.redemption-col--quaternary {
        display: none !important;
    }
}

.redemption-table .person-row__text {
    max-width: clamp(120px, 14vw, 240px);
}

.redemption-row,
.redemption-row > td {
    transition: none;
    animation: none;
}

.redemption-row--selected,
.redemption-row--selected:hover {
    background-color: var(--mud-palette-table-hover);
}

.admin-table__col--w110 { width: 110px; }
.admin-table__col--w120 { width: 120px; }
.admin-table__col--w140 { width: 140px; }
.admin-table__col--w150 { width: 150px; }

.users-table__truncate {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.mud-table-cell.users-table__td--top {
    vertical-align: middle;
}

.mud-table-cell.users-table__td--actions {
    text-align: right;
    white-space: nowrap;
    vertical-align: middle;
    width: 1%;
    padding-left: 0 !important;
}

/* Numeric column: right-aligned so the value sits next to the row actions instead of
   floating at the left edge of a wide cell. */
.mud-table-cell.users-table__col--credits {
    text-align: right;
}

@media (max-width: 960px) {
    .admin-table-wrapper .mud-table-body .mud-table-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px 16px;
        padding: var(--tp-space-3) var(--tp-space-4);
        border-bottom: 1px solid var(--mud-palette-table-lines);
    }

    .admin-table-wrapper .mud-table-body .mud-table-row:last-child {
        border-bottom: none;
    }

    .admin-table-wrapper .mud-table-body .mud-table-row .mud-table-cell {
        display: block;
        flex: 1 1 calc(50% - 8px);
        order: 2;
        min-width: 0;
        padding: 0;
        border: none !important;
        text-align: left !important;
    }

    .admin-table-wrapper .mud-table-body .mud-table-row .mud-table-cell::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 2px;
        padding: 0;
        font-size: 0.75rem;
        font-weight: 700;
        color: var(--mud-palette-text-secondary);
    }

    .admin-table-wrapper .mud-table-body .mud-table-row .mud-table-cell:first-child {
        flex: 1 1 calc(100% - 112px);
        order: 0;
    }

    .admin-table-wrapper .mud-table-body .mud-table-row .mud-table-cell.admin-col--desktop {
        display: none !important;
    }

    .admin-table-wrapper .mud-table-body .mud-table-row .mud-table-cell:first-child::before,
    .admin-table-wrapper .mud-table-body .mud-table-row .mud-table-cell:last-child::before {
        display: none;
    }

    .admin-table-wrapper .mud-table-body .mud-table-row .mud-table-cell:last-child {
        flex: none;
        order: 1;
        width: auto;
        margin-left: auto;
    }
}

@media (min-width: 961px) {
    .users-table .mud-table-root {
        min-width: 1060px;
    }

    .users-table__col--user {
        width: 22%;
    }

    .users-table__col--email {
        width: 24%;
    }

    td.users-table__col--user,
    td.users-table__col--email {
        max-width: 0;
    }

    .users-table__col--created,
    .users-table__col--last-login {
        width: 120px;
        white-space: nowrap;
    }

    .mud-table-cell.users-table__col--credits {
        width: 100px;
        white-space: nowrap;
    }
}

.admin-table__th--min {
    width: 1%;
    white-space: nowrap;
}

.mud-table-cell.admin-table__td--chevron {
    text-align: right;
    width: 1%;
}

.admin-sort-header {
    display: inline-flex;
    align-items: center;
    gap: var(--tp-space-1);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.mud-table-cell.admin-table__td--actions {
    text-align: right;
    white-space: nowrap;
    width: 1%;
}

.authors-table__profiles {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 200px;
    min-width: 0;
}

.authors-table__profiles .author-profile-chip {
    flex-shrink: 1;
    min-width: 0;
}

.authors-table__profiles > :not(.author-profile-chip) {
    flex: none;
}

.authors-table__billing-icon {
    font-size: var(--tp-icon-size);
    flex-shrink: 0;
}

.min-width-0 {
    min-width: 0;
}

.fw-medium {
    font-weight: 500 !important;
}

.text-nowrap {
    white-space: nowrap !important;
}

.fw-bold,
.fw-semibold {
    font-weight: 700 !important;
}

.admin-authors-toolbar__count {
    display: flex;
    align-items: center;
    gap: 6px;
    height: var(--tp-chip-height);
    padding: 0 var(--tp-chip-padding-x);
    border-radius: var(--tp-pill-radius);
    background: var(--tp-pill-neutral-bg);
}

.admin-authors-toolbar__count .mud-typography {
    font-size: var(--tp-chip-font-size);
    font-weight: 600;
    line-height: 1;
}

.admin-authors-toolbar__count-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--tp-chip-icon-size);
    height: var(--tp-chip-icon-size);
}

.admin-authors-toolbar__count-icon .mud-icon-root {
    font-size: var(--tp-chip-icon-size);
}

.admin-authors-toolbar__count-skel {
    width: 62px;
    height: 13px;
}

@container (max-width: 599.98px) {
    .tab-bar-slot--right .admin-authors-toolbar__count {
        height: auto;
        padding: 0;
        background: none;
        font-size: 0.8125rem;
        color: var(--mud-palette-text-secondary);
    }

    .tab-bar-slot--right .admin-authors-toolbar__count-icon {
        width: 20px;
        height: 20px;
    }
}

.nav-section-label {
    font-size: var(--tp-label-size);
    font-weight: var(--tp-label-weight);
    letter-spacing: var(--tp-label-tracking);
    text-transform: uppercase;
    color: var(--tp-label-color);
    padding: 16px 14px 6px;
}

/* shared expand animation (matches chapter review) */
.pkgm-chevron {
    color: var(--tp-text-muted);
    transition: transform var(--tp-dur) var(--tp-ease), opacity var(--tp-dur-fast) ease;
}

.pkgm-chevron--open {
    transform: rotate(180deg);
    color: var(--tp-text);
}

/* chapter-review story grouping */
.review-group__band {
    display: flex;
    align-items: center;
    gap: var(--tp-space-3);
    padding: var(--tp-space-3) var(--tp-space-4);
    background-color: color-mix(in srgb, var(--mud-palette-text-primary) 3%, transparent);
    border-bottom: 1px solid var(--tp-border);
}

.review-group__info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.review-group__heading,
.pkgm-chapter__heading {
    display: flex;
    align-items: center;
    gap: var(--tp-space-2);
    min-width: 0;
}

.review-group__title {
    min-width: 0;
    font-weight: 700;
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.review-group__meta-line {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}

/* the last chapter row's trailing divider would double up with the card border */
.review-group__rows > .mud-divider:last-child,
.chapter-review-list > .mud-divider:last-child {
    display: none;
}

/* rebuild-in-progress indicator */
.pkgm-building {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--tp-warning);
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.pkgm-building__spinner {
    font-size: var(--tp-icon-size-xs) !important;
    width: var(--tp-icon-size-xs) !important;
    height: var(--tp-icon-size-xs) !important;
    color: var(--tp-warning);
    animation: pkgm-spin 0.9s linear infinite;
}

@keyframes pkgm-spin {
    to {
        transform: rotate(360deg);
    }
}

.pkgm-story__pills {
    display: flex;
    align-items: center;
    gap: var(--tp-space-2);
    flex: none;
}

/* connected "build from snapshot" control */
.pkgm-build {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--tp-radius-sm);
    overflow: hidden;
}

/* chapters */
.pkgm-chapters {
    border-top: 1px solid var(--mud-palette-divider);
}

.pkgm-chapter {
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.pkgm-chapter:last-child {
    border-bottom: none;
}

.pkgm-chapter__band {
    display: flex;
    align-items: center;
    gap: var(--tp-space-3);
    padding: 12px 18px 12px 20px;
    cursor: pointer;
}

.pkgm-chapter__band:hover {
    background-color: var(--tp-hover);
}

/* snapshot-only chapter: no package to expand */
.pkgm-chapter__band--static {
    cursor: default;
}

.pkgm-chapter__band--static:hover {
    background-color: transparent;
}

.pkgm-chevron--hidden {
    visibility: hidden;
}

.pkgm-chapter__info {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pkgm-chapter__title {
    font-size: 0.875rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pkgm-chapter__snapshot {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}

.pkgm-chapter__snapshot-icon {
    font-size: var(--tp-icon-size-xs) !important;
    width: var(--tp-icon-size-xs) !important;
    height: var(--tp-icon-size-xs) !important;
}

.pkgm-chapter__chips {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: none;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* version rows */
.pkgm-versions {
    margin: 0 18px 0 54px;
    padding: var(--tp-space-1) 0 var(--tp-space-2);
    border-top: 1px solid var(--tp-line-quiet);
}

.pkgm-version {
    display: flex;
    align-items: center;
    gap: var(--tp-space-3);
    min-height: 44px;
    padding: 6px 4px;
    border-top: 1px solid var(--mud-palette-divider);
}

.pkgm-version:first-child {
    border-top: none;
}

.pkgm-version__content {
    font-size: 0.8125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.pkgm-version__schema {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.pkgm-version__schema--old {
    color: var(--tp-warning);
    font-weight: 600;
}

.pkgm-version__meta {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.pkgm-version__actions {
    display: flex;
    align-items: center;
    flex: none;
}

.skel {
    position: relative;
    overflow: hidden;
    background-color: var(--tp-skeleton);
    border-radius: var(--tp-radius-sm);
    flex: none;
}

.skel::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg,
        transparent,
        var(--tp-skeleton-shine),
        transparent);
    animation: app-shimmer var(--tp-shimmer-dur) ease-in-out infinite;
}

.skel--onDark {
    background-color: rgba(255, 255, 255, 0.09);
}

.skel--onDark::after {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.13), transparent);
}

.skel--text {
    border-radius: 4px;
}

.skel--pill {
    border-radius: var(--tp-radius-pill);
}

@media (prefers-reduced-motion: reduce) {
    .skel::after {
        animation: none;
    }
}

/* Add-role affordance on the admin user detail header. */
.role-add-trigger.mud-icon-button {
    color: var(--mud-palette-text-secondary);
}

.role-add-trigger.mud-icon-button:hover {
    color: var(--mud-palette-text-primary);
}

.role-menu.mud-list {
    width: 268px;
    padding: 6px;
}

/* MudList draws a rule between items; the design groups them by spacing instead. */
.role-menu.mud-list .mud-list-item,
.role-menu.mud-list .mud-menu-item {
    border-top: 0 !important;
    border-bottom: 0 !important;
}

.role-menu__title {
    padding: 6px 8px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--mud-palette-text-secondary);
}

.role-menu__item.mud-menu-item {
    border-radius: var(--tp-radius);
    padding: var(--tp-space-1) var(--tp-space-3);
    min-height: 32px;
}

.role-menu__item.mud-menu-item:hover {
    background-color: var(--tp-hover);
}

.role-menu__row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.role-menu__lead.mud-icon-root {
    flex-shrink: 0;
    font-size: var(--tp-icon-size-sm);
    color: var(--mud-palette-text-secondary);
}

.role-menu__text {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

.role-menu__label {
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--mud-palette-text-primary);
}

.role-menu__note {
    font-size: 0.6875rem;
    line-height: 1.4;
    color: var(--mud-palette-text-secondary);
}

.role-menu__shield.mud-icon-root {
    flex-shrink: 0;
    font-size: var(--tp-icon-size-sm);
    color: var(--tp-text-faint);
}

.mud-divider.role-menu__divider {
    margin: 6px 4px 0;
}

.role-menu__hint {
    padding: var(--tp-space-2);
    font-size: 0.6875rem;
    line-height: 1.45;
    color: var(--mud-palette-text-secondary);
    text-wrap: pretty;
}

/* Package and review bands put a flex:none pill/chip/button group next to the title column. On a
   phone that group squeezes the title to nothing and then overflows the card, so below Sm the band
   wraps and the group takes a line of its own. These rules sit at the end of the file because the
   base flex:none declarations come later in the cascade and a media query adds no specificity. */
@media (max-width: 599.98px) {
    .pkgm-chapter__band,
    .review-group__band {
        flex-wrap: wrap;
        row-gap: 10px;
    }

    .pkgm-chapter__info,
    .review-group__info {
        flex: 1 1 140px;
    }

    .pkgm-story__pills,
    .pkgm-chapter__chips {
        flex: 1 1 100%;
        flex-wrap: wrap;
        row-gap: var(--tp-space-2);
        justify-content: flex-start;
    }

    .pkgm-chapter__chips {
        padding-left: var(--tp-space-6);
    }

    .pkgm-versions {
        margin: 0 var(--tp-space-3) 0 var(--tp-space-4);
    }

    .pkgm-version {
        flex-wrap: wrap;
        gap: var(--tp-space-2);
    }

    .pkgm-version__meta {
        margin-left: 0;
        flex: 1 1 60%;
    }

    .role-menu-popover {
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        max-width: none !important;
    }

    .role-menu.mud-list {
        width: 100%;
    }
}

.manage-contributors-add-menu {
    width: 17rem;
    padding: 4px;
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius);
    background: var(--tp-surface);
    box-shadow: var(--tp-shadow-lg, 0 12px 28px rgba(0, 0, 0, 0.45));
}

.manage-contributors-add-menu .mud-list {
    padding: 0;
}

.manage-contributors-add-menu .mud-menu-item {
    min-height: 0;
    padding: 8px 10px;
    border-radius: var(--tp-radius-sm);
}

.manage-contributors-add-option {
    display: flex;
    align-items: center;
    gap: var(--tp-space-3);
}

.manage-contributors-add-option .mud-icon-root {
    flex: none;
    color: var(--tp-text-secondary);
}

.manage-contributors-add-option__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    line-height: 1.3;
}

.manage-contributors-add-option__label {
    font-size: 0.875rem;
    font-weight: 600;
}

.manage-contributors-add-option__hint {
    font-size: 0.75rem;
    color: var(--tp-text-secondary);
}
