.modern-page-title {
    position: relative;
    margin: 1.35rem 0 1.8rem;
    color: var(--bs-primary);
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.08;
}

.modern-page-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.7rem;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: var(--bs-primary);
    opacity: 0.18;
}

.modern-page-title + hr,
.modern-details-panel > hr {
    display: none;
}

.modern-copy {
    color: #424b57;
    font-size: 1.08rem;
    line-height: 1.65;
}

.modern-form-page > [class*="col-"] {
    max-width: 1120px;
}

.modern-form-page > .col-md-4 {
    flex: 0 0 min(100%, 720px);
    max-width: min(100%, 720px);
}

.modern-form-page form,
.modern-details-panel dl.row,
.modern-filter-panel form {
    max-width: 1120px;
    padding: 1.25rem;
    border: 3px solid var(--bs-primary);
    border-radius: 6px;
    background: white;
    box-shadow: 4px 3px 4px rgba(var(--bs-primary-rgb), 0.18);
}

.modern-form-page .form-group {
    margin-bottom: 1.05rem;
}

.modern-form-page label.control-label,
.modern-form-page form b label,
.modern-details-panel dt[class*="col-"],
.modern-details-panel dt[class*="col-sm-"],
.modern-filter-panel .form-label {
    color: var(--bs-primary);
    font-size: 1.04rem;
    font-weight: 700;
}

.modern-details-panel dd[class*="col-"],
.modern-details-panel dd[class*="col-sm-"] {
    color: dimgray;
    font-size: 1.04rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.modern-details-panel dl.row > dt,
.modern-details-panel dl.row > dd {
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    border-top: 1px solid rgba(var(--bs-primary-rgb), 0.12);
}

.modern-details-panel dl.row > dt:first-child,
.modern-details-panel dl.row > dt:first-child + dd {
    border-top: 0;
}

.modern-form-page .form-control,
.modern-filter-panel .form-control,
.modern-login-panel .form-control,
.modern-form-section .form-control {
    min-height: 3rem;
    margin-bottom: 0;
    border: 2px solid rgba(var(--bs-primary-rgb), 0.18);
    border-radius: 6px;
    color: #343a40;
    font-size: 1.04rem;
    font-weight: 600;
    background: white;
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modern-form-page textarea.form-control,
.modern-form-section textarea.form-control {
    min-height: 7rem;
}

.modern-form-page .form-control:focus,
.modern-filter-panel .form-control:focus,
.modern-login-panel .form-control:focus,
.modern-form-section .form-control:focus {
    border-color: rgba(var(--bs-primary-rgb), 0.8);
    box-shadow: 0 0 0 0.18rem rgba(var(--bs-primary-rgb), 0.14);
}

.modern-form-page .form-control[readonly],
.modern-form-page .form-control:disabled,
.modern-login-panel .form-control[readonly],
.modern-login-panel .form-control:disabled {
    color: #606975;
    background: rgba(var(--bs-primary-rgb), 0.07);
    border-color: rgba(var(--bs-primary-rgb), 0.16);
}

.modern-form-page input[type="checkbox"],
.modern-form-page input[type="radio"],
.modern-form-section input[type="checkbox"],
.modern-filter-panel input[type="radio"] {
    accent-color: var(--bs-primary);
}

.modern-form-page input[type="submit"].btn,
.modern-filter-panel input[type="submit"].btn,
.modern-login-panel .btn-primary {
    min-height: 2.8rem;
    min-width: 8rem;
    border: 2px solid var(--bs-primary);
    border-radius: 6px;
    color: white;
    background: var(--bs-primary);
    font-weight: 700;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.modern-form-page input[type="submit"].btn:hover,
.modern-filter-panel input[type="submit"].btn:hover,
.modern-login-panel .btn-primary:hover {
    color: var(--bs-primary);
    background: white;
    transform: translateY(-1px);
}

.modern-form-page input[type="submit"].btn:disabled,
.modern-form-page input[type="submit"].btn:disabled:hover {
    border-color: rgba(108, 117, 125, 0.45);
    color: #6c757d;
    background: #e9ecef;
    transform: none;
    cursor: not-allowed;
}

.modern-form-page input[type="submit"][style*="width:400px"],
.modern-form-page input[type="submit"][style*="width: 400px"],
.modern-form-page input[type="submit"][style*="width:350px"],
.modern-form-page input[type="submit"][style*="width: 350px"],
.modern-form-page input[type="submit"][style*="width:200px"],
.modern-form-page input[type="submit"][style*="width: 200px"] {
    width: min(100%, 18rem) !important;
    height: auto !important;
    padding: 0.55rem 1rem;
}

.modern-filter-panel form {
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: end !important;
}

.modern-filter-panel form > div {
    margin: 0 !important;
}

.modern-table-panel,
.modern-log-table {
    margin-top: 1rem;
}

.modern-table-panel {
    padding: 0.9rem;
    border: 3px solid rgba(var(--bs-primary-rgb), 0.85);
    border-radius: 6px;
    background: white;
    box-shadow: 4px 3px 4px rgba(var(--bs-primary-rgb), 0.15);
}

.modern-table-panel table.table,
.modern-log-table.table {
    margin-bottom: 0;
}

.modern-table-panel table.table thead th,
.modern-log-table thead th {
    color: rgba(0, 0, 0, 0.58);
    font-size: 1rem;
    font-weight: 800;
    border-bottom: 2px solid rgba(var(--bs-primary-rgb), 0.2);
}

.modern-table-panel table.table tbody td,
.modern-log-table tbody td {
    color: #46505c;
    font-weight: 500;
    vertical-align: middle;
}

.modern-table-panel table.table-hover tbody tr:hover,
.modern-log-table.table-hover tbody tr:hover {
    background: rgba(var(--bs-primary-rgb), 0.06);
}

.modern-form-page form div.table.table-hover {
    display: block;
    overflow-x: auto;
    padding: 0.8rem;
    border: 2px solid rgba(var(--bs-primary-rgb), 0.18);
    border-radius: 6px;
    background: rgba(var(--bs-primary-rgb), 0.04);
}

.modern-form-page form div.table.table-hover table {
    width: 100%;
}

.modern-form-page form div.table.table-hover td {
    padding: 0.45rem 0.75rem 0.45rem 0;
    white-space: nowrap;
}

.modern-form-section {
    padding: 1rem;
    border: 2px solid rgba(var(--bs-primary-rgb), 0.18);
    border-radius: 6px;
    background: rgba(var(--bs-primary-rgb), 0.04);
}

.modern-form-section + .modern-form-section {
    margin-top: 1rem;
}

.modern-form-section .form-group:last-child {
    margin-bottom: 0;
}

.modern-form-section-title {
    margin-bottom: 0.6rem;
    color: var(--bs-primary);
    font-size: 1.08rem;
    font-weight: 800;
}

.modern-form-section label {
    display: block;
    margin-bottom: 0.5rem;
    color: #46505c;
    font-weight: 600;
}

.modern-submit-row {
    display: flex;
    flex-wrap: wrap;
    margin-top: 1.2rem;
    margin-bottom: 1.2rem;
}

.modern-choice-list {
    display: grid;
    gap: 0.55rem;
    padding: 0.75rem;
    border: 2px solid rgba(var(--bs-primary-rgb), 0.18);
    border-radius: 6px;
    background: rgba(var(--bs-primary-rgb), 0.04);
}

.modern-choice-list-inline,
.modern-checkbox-grid {
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.modern-checkbox-grid {
    display: grid;
    gap: 0.55rem;
}

.modern-choice-item {
    display: flex !important;
    align-items: center;
    gap: 0.48rem;
    min-width: 0;
    margin: 0 !important;
    padding: 0.48rem 0.58rem;
    border: 1px solid transparent;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.82);
    color: #46505c;
    font-weight: 650;
    line-height: 1.35;
}

.modern-choice-item:hover {
    border-color: rgba(var(--bs-primary-rgb), 0.24);
    background: white;
}

.modern-choice-item-disabled {
    color: #6c757d;
    background: rgba(233, 236, 239, 0.8);
}

.modern-choice-item input {
    flex: 0 0 auto;
}

.modern-choice-item span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.modern-checkbox-field {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.modern-checkbox-field b,
.modern-checkbox-field label {
    margin-bottom: 0;
}

.modern-alert {
    width: min(1120px, 100%);
    border-width: 2px;
    border-radius: 6px;
    font-size: 1.04rem;
    font-weight: 650;
}

.modern-line-panel {
    width: min(1120px, 100%);
    margin-top: 1rem;
}

.modern-link-list,
.modern-inline-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-width: 0;
}

.modern-link-list a,
.modern-link-list span,
.modern-inline-list span {
    display: inline-flex;
    align-items: center;
    min-height: 2.1rem;
    max-width: 100%;
    padding: 0.28rem 0.55rem;
    border: 1px solid rgba(var(--bs-primary-rgb), 0.16);
    border-radius: 5px;
    background: rgba(var(--bs-primary-rgb), 0.05);
    color: #46505c;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.modern-link-list a {
    color: var(--bs-primary);
    text-decoration: none;
}

.modern-link-list a:hover {
    border-color: var(--bs-primary);
    background: white;
    text-decoration: none;
}

.modern-data-table {
    min-width: 780px;
}

.day-care-schedule-table {
    min-width: 1060px;
}

.modern-command-col {
    width: 230px;
}

.modern-primary-cell {
    color: rgb(65,105,225);
    font-size: 1.18rem;
    font-weight: 800;
}

.modern-count-cell {
    color: forestgreen;
    font-size: 1.22rem;
    font-weight: 900;
}

.modern-table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.modern-table-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0.18rem 0.5rem;
    border: 2px solid rgba(var(--bs-primary-rgb), 0.52);
    border-radius: 4px;
    color: var(--bs-primary);
    font-weight: 750;
    text-decoration: none;
    white-space: nowrap;
}

.modern-table-actions a:hover {
    border-color: var(--bs-primary);
    background: var(--bs-primary);
    color: white;
    text-decoration: none;
}

.modern-stack {
    display: grid;
    gap: 0.9rem;
    margin-top: 1rem;
}

.modern-stack h3,
.modern-details-panel h4 {
    color: var(--bs-primary);
    font-weight: 700;
}

.modern-stack-item {
    padding: 1rem;
    border: 2px solid rgba(var(--bs-primary-rgb), 0.16);
    border-radius: 6px;
    background: white;
}

.modern-stack-item > p:first-child {
    margin-bottom: 0.5rem;
    color: var(--bs-primary);
    font-weight: 800;
}

.modern-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 1rem 0 1.5rem;
}

.modern-action-row a,
.modern-hero-action {
    min-height: 2.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border: 2px solid var(--bs-primary);
    border-radius: 5px;
    background: white;
    color: var(--bs-primary);
    font-weight: 700;
    text-decoration: none;
}

.modern-action-row a:hover,
.modern-hero-action:hover {
    background: var(--bs-primary);
    color: white;
    text-decoration: none;
}

.modern-landing {
    width: min(1180px, 100%);
    margin: 1.8rem 0 3rem;
}

.modern-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(2rem, 4vw, 4rem);
    border-left: 7px solid var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.06);
}

.modern-hero h1 {
    color: var(--bs-primary);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 800;
    line-height: 1.02;
    margin: 0 0 1rem;
}

.modern-hero p {
    max-width: 980px;
    color: #424b57;
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 0;
}

.modern-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.35rem;
}

.modern-hero-action {
    min-height: 2.8rem;
    padding: 0.45rem 1rem;
    border-radius: 6px;
    font-weight: 800;
}

.modern-hero-action-secondary {
    border-color: rgba(var(--bs-primary-rgb), 0.55);
}

.modern-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.modern-card {
    padding: 1.1rem;
    border: 3px solid var(--bs-primary);
    border-radius: 6px;
    background: white;
    box-shadow: 4px 3px 4px rgba(var(--bs-primary-rgb), 0.14);
}

.modern-card h2,
.modern-card h3,
.modern-card h5 {
    color: var(--bs-primary);
    font-weight: 800;
}

.modern-card p,
.modern-card li {
    color: #46505c;
    font-size: 1.02rem;
    line-height: 1.55;
}

.modern-login-page {
    width: min(720px, 100%);
    margin: 1.5rem 0 3rem;
}

.modern-login-panel {
    background: transparent;
}

.modern-login-panel .validation-summary-valid {
    display: none;
}

.modern-login-guidance {
    display: grid;
    gap: 0.35rem;
}

.modern-login-guidance a {
    font-weight: 800;
}

.modern-login-panel .form-group {
    margin-bottom: 1.05rem;
}

.modern-login-panel .modern-login-submit-row {
    margin-top: 1.35rem;
    margin-bottom: 1.55rem;
}

.modern-login-panel label {
    color: var(--bs-primary);
    font-size: 1.04rem;
    font-weight: 700;
}

.modern-login-links {
    display: grid;
    justify-items: start;
    gap: 0.45rem;
    margin-top: 1.25rem;
}

.modern-login-links a {
    color: var(--bs-primary);
    font-weight: 700;
    text-decoration: none;
}

.modern-login-links a:hover {
    color: mediumpurple;
    text-decoration: underline;
}

.modern-login-sso {
    margin-top: 1.5rem;
}

.modern-login-divider {
    color: #596273;
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
}

.modern-login-sso .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

/* Collection pages */
.collection-page {
    --collection-index-columns: minmax(22rem, 1fr) 10rem minmax(10rem, 1fr) 8rem 20rem;
    width: min(1460px, 100%);
    padding-bottom: 2rem;
}

.collection-page .title,
.collection-page .modern-page-title {
    margin-left: 0;
}

.collection-page .modern-action-row {
    align-items: center;
}

.collection-page .modern-table-panel {
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.collection-page .modern-action-row a.collection-danger-link,
.collection-page .modern-table-actions a.collection-danger-link {
    border-color: rgba(220, 53, 69, 0.85);
    color: #dc3545;
}

.collection-page .modern-action-row a.collection-danger-link:hover,
.collection-page .modern-table-actions a.collection-danger-link:hover {
    border-color: #dc3545;
    background: #dc3545;
    color: white;
}

.collection-page .collection-index-table {
    table-layout: auto;
    min-width: 1180px;
}

.collection-page .collection-index-table > tbody > tr.collection-disabled-source-row > td {
    --bs-table-bg: #fff8d8;
    background-color: #fff8d8;
}

.collection-page .collection-index-table > tbody > tr.collection-disabled-source-row:hover > td {
    --bs-table-accent-bg: #fff3c4;
    background-color: #fff3c4;
}

.collection-page .collection-chapter-table {
    table-layout: fixed;
    min-width: 980px;
}

.collection-page .collection-row-summary {
    display: block;
    min-width: 0;
}

.collection-page .collection-row-summary summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.collection-page .collection-row-summary summary::before {
    color: var(--bs-primary);
}

.collection-page .collection-index-header-grid {
    display: grid;
    grid-template-columns: var(--collection-index-columns);
    gap: 1rem;
    align-items: center;
    padding-left: 1.9rem;
}

.collection-page .collection-summary-grid {
    display: grid;
    grid-template-columns: var(--collection-index-columns);
    gap: 1rem;
    align-items: center;
    min-width: 0;
}

.collection-page .collection-summary-title {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: baseline;
    min-width: 0;
}

.collection-page .collection-title-link,
.collection-page .collection-chapter-link {
    display: inline-block;
    max-width: 100%;
    color: rgb(65,105,225);
    font-weight: 800;
    text-decoration: none;
    overflow-wrap: anywhere;
    word-break: normal;
    transition: color 0.2s ease, transform 0.2s ease;
}

.collection-page .collection-title-link {
    font-size: 1.42rem;
}

.collection-page .collection-chapter-link {
    font-size: 1.08rem;
}

.collection-page .collection-title-link:hover,
.collection-page .collection-chapter-link:hover {
    color: dimgray;
    transform: scale(1.015);
}

.collection-page .collection-muted-line {
    color: #6c757d;
    font-weight: 650;
}

.collection-page .collection-language-pill,
.collection-page .collection-audio-pill {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.2rem 0.62rem;
    border: 2px solid rgba(var(--bs-primary-rgb), 0.35);
    border-radius: 5px;
    color: var(--bs-primary);
    background: white;
    font-weight: 800;
    white-space: nowrap;
}

.collection-page .collection-audio-pill-muted {
    border-color: rgba(108, 117, 125, 0.35);
    color: #6c757d;
    background: #f8f9fa;
}

.collection-page .collection-count {
    color: forestgreen;
    font-size: 1.28rem;
    font-weight: 900;
}

.collection-page .collection-use-count-link {
    color: forestgreen;
    font-size: 1.28rem;
    font-weight: 900;
    text-decoration: underline;
}

.collection-page .collection-use-count-link:hover {
    color: darkgreen;
}

.collection-page .collection-listeners {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem;
    align-items: center;
    min-width: 0;
}

.collection-page .collection-listeners a {
    color: mediumpurple;
    font-weight: 700;
    text-decoration: none;
}

.collection-page .collection-listeners a:hover {
    color: rebeccapurple;
    text-decoration: underline;
}

.collection-page .collection-class-session-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
}

.collection-page .collection-class-session-links a {
    font-weight: 700;
}

.collection-page .collection-chapter-list {
    display: grid;
    gap: 0.55rem;
    margin: 0.85rem 0 0 1.9rem;
}

.collection-page .collection-chapter-row {
    display: grid;
    grid-template-columns: var(--collection-index-columns);
    gap: 1rem;
    align-items: center;
    padding: 0.6rem 0.7rem;
    border-left: 4px solid rgba(var(--bs-primary-rgb), 0.18);
    background: rgba(var(--bs-primary-rgb), 0.035);
}

.collection-page .collection-chapter-row.collection-disabled-source-row {
    background: #fff8d8;
}

.collection-page .collection-chapter-row > span:first-child {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    min-width: 0;
}

.collection-page .collection-chapter-row > .modern-table-actions {
    margin-left: 0.7rem;
}

.collection-page .collection-chapter-number {
    color: var(--bs-primary);
    font-size: 1.1rem;
    font-weight: 900;
}

.collection-page.collection-chapter-details-shell {
    width: 100%;
    max-width: none;
}

.collection-page.collection-details-page {
    width: 100%;
    max-width: none;
}

.collection-page .collection-description {
    margin: 1rem 0 0;
    padding: 0.85rem 1rem;
    border-left: 5px solid rgba(var(--bs-primary-rgb), 0.55);
    background: rgba(var(--bs-primary-rgb), 0.045);
    color: #424b57;
    font-size: 1.06rem;
    font-weight: 650;
    line-height: 1.55;
}

.collection-page .collection-detail-chapters {
    display: grid;
    width: 100%;
    gap: 0;
}

.collection-page .collection-detail-chapter-header,
.collection-page .collection-detail-chapter-row {
    display: grid;
    grid-template-columns: minmax(5rem, 0.4fr) minmax(16rem, 1.45fr) minmax(7rem, 0.5fr) minmax(12rem, 1.2fr) minmax(14rem, 1.35fr) minmax(14rem, auto);
    gap: 1rem;
    align-items: center;
}

.collection-page .collection-detail-chapter-header {
    padding: 0.55rem 0.45rem;
    border-bottom: 2px solid rgba(52, 58, 64, 0.55);
}

.collection-page .collection-detail-chapter-row {
    min-height: 3.4rem;
    padding: 0.55rem 0.45rem;
    border-bottom: 1px solid rgba(52, 58, 64, 0.12);
}

.collection-page .collection-detail-chapter-row:hover {
    background: rgba(var(--bs-primary-rgb), 0.035);
}

.collection-page .collection-detail-chapter-row.collection-disabled-source-row {
    background: #fff8d8;
}

.collection-page .collection-detail-chapter-row.collection-disabled-source-row:hover {
    background: #fff3c4;
}

.collection-page .collection-detail-chapter-cell {
    min-width: 0;
}

.collection-page .collection-detail-chapter-cell .modern-table-actions {
    justify-content: flex-end;
}

.collection-page .collection-details {
    width: min(1180px, 100%);
}

.collection-page .collection-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.2rem;
}

.collection-page .collection-details-list {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    align-content: start;
    row-gap: 0.7rem;
    column-gap: 1.6rem;
    margin: 0;
    padding: 1.25rem;
    border: 3px solid var(--bs-primary);
    border-radius: 6px;
    background: white;
    box-shadow: 4px 3px 4px rgba(var(--bs-primary-rgb), 0.18);
}

.collection-page .collection-label {
    color: var(--bs-primary);
    font-size: 1.25rem;
    font-weight: 700;
}

.collection-page .collection-value {
    min-width: 0;
    color: dimgray;
    font-size: 1.16rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.collection-page .collection-value a {
    color: mediumpurple;
    text-decoration: none;
}

.collection-page .collection-value a:hover {
    color: rebeccapurple;
    text-decoration: underline;
}

.collection-page .collection-full-width {
    grid-column: 1 / -1;
}

.collection-page .collection-text-panel {
    width: min(1120px, 100%);
    margin-top: 1.4rem;
}

.collection-page .collection-text-panel textarea.form-control {
    min-height: 13rem;
    margin-bottom: 0;
    border: 3px solid rgba(var(--bs-primary-rgb), 0.28);
    border-radius: 6px;
    color: #424b57;
    font-size: 1.06rem;
    font-weight: 600;
    line-height: 1.55;
    background: white;
}

.collection-page .collection-chapter-reading-panel {
    width: 100%;
    margin-top: 1.4rem;
    padding: 1.25rem;
    border-radius: 6px;
    box-sizing: border-box;
    background: rgba(var(--bs-primary-rgb), 0.045);
    box-shadow: 4px 3px 4px rgba(var(--bs-primary-rgb), 0.18);
}

.collection-page .collection-chapter-reading-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.collection-page .collection-chapter-reading-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.collection-page .collection-chapter-reading-title {
    position: relative;
    display: inline-block;
    margin: 0 0 1rem;
    color: var(--bs-primary);
    font-size: 1.8rem;
    font-weight: 600;
}

.collection-page .collection-chapter-reading-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background-color: var(--bs-primary);
    opacity: 0.3;
}

.collection-page .collection-text-audio {
    display: block;
    width: 100%;
    min-width: 0;
    margin-bottom: 0.85rem;
}

.collection-page .collection-chapter-reading-text {
    display: block;
    flex: 1 1 auto;
    width: 100%;
    min-height: 26rem;
    padding: 0.7rem;
    color: #2f3846;
    background: white;
    border: 2px solid rgba(var(--bs-primary-rgb), 0.18);
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.68;
    resize: vertical;
}

.collection-page .collection-test-word-panel {
    flex: 1 1 auto;
    min-height: 26rem;
    padding: 0.75rem;
    color: var(--bs-primary);
    background: white;
    border: 2px solid rgba(var(--bs-primary-rgb), 0.18);
    border-radius: 6px;
    box-sizing: border-box;
}

.collection-page .collection-test-word-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 0.4rem 1rem;
    align-items: start;
    margin: 0;
    padding: 0;
    list-style: none;
}

.collection-page .collection-test-word-item {
    min-width: 0;
}

.collection-page .collection-test-word-item details {
    min-width: 0;
}

.collection-page .collection-test-word-item summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    padding: 0.3rem 0.4rem;
    cursor: pointer;
    list-style: none;
    background: #f3f6ff;
    border: 1px solid #d8e0ff;
    border-radius: 3px;
}

.collection-page .collection-test-word-item summary::-webkit-details-marker {
    display: none;
}

.collection-page .collection-test-word-link {
    overflow-wrap: anywhere;
    color: var(--bs-primary);
    font-weight: 700;
    text-decoration: underline;
}

.collection-page .collection-test-word-audio-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 1.75rem;
    height: 1.75rem;
    color: white;
    background: var(--bs-primary);
    border: 1px solid var(--bs-primary);
    border-radius: 50%;
    font-size: 0.8rem;
    line-height: 1;
}

.collection-page .collection-test-word-audio-button:hover,
.collection-page .collection-test-word-audio-button:focus {
    color: var(--bs-primary);
    background: white;
    outline: none;
}

.collection-page .collection-test-word-native-definition {
    flex-basis: 100%;
    margin-left: 1.35rem;
    color: #253248;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.25;
}

.collection-page .collection-test-word-definition {
    margin: 0.25rem 0 0.65rem;
    padding: 0.55rem 0.65rem;
    overflow-wrap: anywhere;
    color: #253248;
    background: #f8faff;
    border-left: 4px solid var(--bs-primary);
    line-height: 1.35;
}

.collection-page .collection-test-word-pos {
    margin-right: 0.35rem;
    color: var(--bs-primary);
    font-weight: 800;
}

.collection-page .collection-test-word-muted {
    color: #647084;
}

.collection-page .collection-chapter-attachments-panel {
    width: 100%;
    margin-top: 1.25rem;
    padding: 1.25rem;
    border: 2px solid rgba(var(--bs-primary-rgb), 0.16);
    border-radius: 6px;
    background: white;
}

.collection-page .collection-chapter-attachments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.collection-page .collection-chapter-attachment-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.collection-page .collection-chapter-attachment-row {
    display: grid;
    grid-template-columns: minmax(10rem, 1fr) auto auto auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(var(--bs-primary-rgb), 0.12);
}

.collection-page .collection-chapter-attachment-row:last-child {
    border-bottom: 0;
}

.collection-page .collection-chapter-attachment-link {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--bs-primary);
    font-weight: 800;
}

.collection-page .collection-chapter-attachment-size,
.collection-page .collection-chapter-attachment-muted {
    color: #647084;
    font-weight: 700;
    white-space: nowrap;
}

.session-collection-attachments-panel {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border: 2px solid rgba(var(--bs-primary-rgb), 0.16);
    border-radius: 6px;
    background: white;
}

.session-collection-attachments-title {
    display: inline-flex;
    gap: 0.45rem;
    align-items: center;
    margin-bottom: 0.65rem;
    color: var(--bs-primary);
    font-size: 1.1rem;
    font-weight: 800;
}

.session-collection-attachments-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.session-collection-attachment-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.75rem;
    align-items: center;
}

.session-collection-attachment-link {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--bs-primary);
    font-weight: 800;
}

.session-collection-attachment-size,
.session-collection-attachment-muted,
.session-collection-attachment-empty {
    color: #647084;
    font-weight: 700;
}

.collection-page .collection-chapter-upload-form {
    margin-top: 1.1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(var(--bs-primary-rgb), 0.14);
}

.collection-page .collection-chapter-upload-grid {
    display: grid;
    grid-template-columns: minmax(14rem, 1fr) minmax(12rem, 0.75fr) auto;
    gap: 0.8rem;
    align-items: end;
}

.collection-page .collection-chapter-upload-grid .form-group {
    margin-bottom: 0;
}

.collection-page .collection-chapter-upload-grid .form-control {
    min-height: 2.7rem;
    border: 2px solid rgba(var(--bs-primary-rgb), 0.18);
    border-radius: 6px;
}

.collection-page .collection-recorder-panel {
    padding: 1rem;
    border: 2px solid rgba(var(--bs-primary-rgb), 0.22);
    border-radius: 6px;
    background: rgba(var(--bs-primary-rgb), 0.045);
}

.collection-page .collection-recording-start-note {
    margin: 0 0 0.75rem;
    padding: 0.55rem 0.7rem;
    border-left: 4px solid rgba(var(--bs-primary-rgb), 0.7);
    border-radius: 4px;
    color: #26354f;
    background: rgba(var(--bs-primary-rgb), 0.08);
    font-weight: 800;
    line-height: 1.4;
}

.collection-page .collection-recorder-panel input[type="radio"]:disabled + .form-check-label {
    color: #6d7484;
    opacity: 0.75;
}

.vocabulary-picker-words {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    min-height: 2.4rem;
    margin-bottom: 0.65rem;
    padding: 0.55rem;
    border: 2px solid rgba(var(--bs-primary-rgb), 0.16);
    border-radius: 6px;
    background: rgba(var(--bs-primary-rgb), 0.04);
}

.collection-unique-words-heading-row {
    align-items: center;
    margin-bottom: 0.6rem;
}

.collection-unique-words-heading-row .collection-chapter-edit-section-title {
    margin-bottom: 0;
}

.vocabulary-relationship-help {
    margin: -0.2rem 0 0.35rem;
    color: #576071;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.35;
}

.vocabulary-batch-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
}

.vocabulary-batch-option {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0;
    color: #344054;
    font-size: 0.88rem;
    font-weight: 700;
}

.vocabulary-batch-option-disabled {
    opacity: 0.52;
    cursor: not-allowed;
}

.vocabulary-batch-option-disabled .form-check-input,
.vocabulary-batch-option-disabled .form-check-label {
    cursor: not-allowed;
}

.vocabulary-batch-record-button.recording {
    color: #fff;
    border-color: #b42318;
    background: #d92d20;
}

.vocabulary-batch-record-button.recording:hover,
.vocabulary-batch-record-button.recording:focus {
    color: #fff;
    border-color: #912018;
    background: #b42318;
}

.vocabulary-batch-status {
    min-height: 1.35rem;
    margin: -0.25rem 0 0.45rem;
    font-size: 0.9rem;
    font-weight: 700;
}

.vocabulary-traffic-light {
    width: 0.86rem;
    height: 0.86rem;
    display: inline-block;
    border-radius: 50%;
    vertical-align: -0.08rem;
    box-shadow: 0 0 0 2px rgba(16, 24, 40, 0.08);
}

.vocabulary-traffic-light-red {
    background: #d92d20;
}

.vocabulary-traffic-light-green {
    background: #12b76a;
}

.vocabulary-batch-retry-button {
    vertical-align: baseline;
    font-weight: 700;
}

.vocabulary-word-button {
    min-height: 2rem;
    padding: 0.2rem 0.55rem;
    border: 2px solid rgba(var(--bs-primary-rgb), 0.25);
    border-radius: 5px;
    color: var(--bs-primary);
    font-weight: 700;
    background: #fff;
}

.vocabulary-word-shell {
    display: inline-flex;
    align-items: center;
    gap: 0.18rem;
    padding: 0.14rem;
    border: 2px solid #d946ef;
    border-radius: 8px;
    background: #fff;
}

.vocabulary-root-word-shell {
    border-color: var(--bs-primary);
}

.vocabulary-batch-target .vocabulary-word-button {
    box-shadow: 0 0 0 2px rgba(2, 122, 72, 0.18);
}

.vocabulary-batch-recording-active .vocabulary-batch-target .vocabulary-word-button {
    color: var(--bs-primary);
    border-color: rgba(var(--bs-primary-rgb), 0.32);
    background: #fff;
}

.vocabulary-batch-recording-active .vocabulary-batch-current,
.vocabulary-play-all-active .vocabulary-play-all-current {
    border-width: 4px;
    padding: 0.05rem;
}

.vocabulary-batch-recording-active .vocabulary-batch-current-green,
.vocabulary-play-all-active .vocabulary-play-all-current {
    border-color: #12b76a;
    background: #ecfdf3;
    box-shadow: 0 0 0 4px rgba(18, 183, 106, 0.2);
}

.vocabulary-batch-recording-active .vocabulary-batch-current-red {
    border-color: #d92d20;
    background: #fff1f0;
    box-shadow: 0 0 0 4px rgba(217, 45, 32, 0.18);
}

.vocabulary-batch-recording-active .vocabulary-batch-current-green .vocabulary-word-button,
.vocabulary-play-all-active .vocabulary-play-all-current .vocabulary-word-button {
    color: #027a48;
    border-color: rgba(2, 122, 72, 0.62);
    background: #f0fdf4;
}

.vocabulary-batch-recording-active .vocabulary-batch-current-red .vocabulary-word-button {
    color: #b42318;
    border-color: rgba(217, 45, 32, 0.66);
    background: #fff7f5;
}

.vocabulary-audio-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.12rem;
}

.vocabulary-audio-control {
    width: 1.75rem;
    height: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 2px solid rgba(var(--bs-primary-rgb), 0.24);
    border-radius: 5px;
    color: var(--bs-primary);
    background: #fff;
    font-size: 0.78rem;
    line-height: 1;
}

.vocabulary-audio-control:disabled {
    color: #98a2b3;
    border-color: rgba(152, 162, 179, 0.42);
    background: #f8fafc;
}

.vocabulary-audio-play:not(:disabled) {
    color: #027a48;
    border-color: rgba(2, 122, 72, 0.48);
    background: #ecfdf3;
}

.vocabulary-audio-record.recording {
    color: #fff;
    border-color: #b42318;
    background: #d92d20;
}

.vocabulary-ignore-control {
    color: #854a0e;
    border-color: rgba(180, 83, 9, 0.45);
    background: #fffbeb;
    font-weight: 800;
}

.vocabulary-ignore-control.is-ignored {
    color: #027a48;
    border-color: rgba(2, 122, 72, 0.48);
    background: #ecfdf3;
}

.vocabulary-word-shell.vocabulary-ignored-for-testing {
    border-color: #98a2b3;
    background: #f8fafc;
}

.vocabulary-word-button.ignored-for-testing,
.vocabulary-word-button.ignored-for-testing:disabled {
    color: #667085;
    border-color: rgba(102, 112, 133, 0.5);
    background: #f2f4f7;
    text-decoration: line-through;
    cursor: not-allowed;
}

.vocabulary-word-button.selected {
    color: #fff;
    border-color: var(--bs-primary);
    background: var(--bs-primary);
}

.vocabulary-word-button.vocabulary-phrase-button {
    border-color: rgba(70, 98, 223, 0.42);
    color: var(--bs-primary);
    background: #fff;
    text-decoration: underline;
    text-decoration-color: rgba(70, 98, 223, 0.72);
    text-underline-offset: 0.18rem;
}

.vocabulary-word-button.vocabulary-phrase-button.selected {
    color: #fff;
    border-color: var(--bs-primary);
    background: var(--bs-primary);
}

.vocabulary-batch-recording-active .vocabulary-batch-current-green .vocabulary-word-button.selected,
.vocabulary-batch-recording-active .vocabulary-batch-current-green .vocabulary-word-button.vocabulary-phrase-button,
.vocabulary-batch-recording-active .vocabulary-batch-current-green .vocabulary-word-button.vocabulary-phrase-button.selected,
.vocabulary-play-all-active .vocabulary-play-all-current .vocabulary-word-button.selected,
.vocabulary-play-all-active .vocabulary-play-all-current .vocabulary-word-button.vocabulary-phrase-button,
.vocabulary-play-all-active .vocabulary-play-all-current .vocabulary-word-button.vocabulary-phrase-button.selected {
    color: #027a48;
    border-color: rgba(2, 122, 72, 0.62);
    background: #f0fdf4;
}

.vocabulary-batch-recording-active .vocabulary-batch-current-red .vocabulary-word-button.selected,
.vocabulary-batch-recording-active .vocabulary-batch-current-red .vocabulary-word-button.vocabulary-phrase-button,
.vocabulary-batch-recording-active .vocabulary-batch-current-red .vocabulary-word-button.vocabulary-phrase-button.selected {
    color: #b42318;
    border-color: rgba(217, 45, 32, 0.66);
    background: #fff7f5;
}

.vocabulary-related-word-group {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.vocabulary-picker-empty {
    color: #667085;
    font-weight: 700;
}

.vocabulary-picker-loading {
    color: var(--bs-primary);
}

.vocabulary-picker-target {
    font-weight: 700;
}

.vocabulary-picker-storage {
    display: none;
}

.vocabulary-picker-flow-editor {
    font-weight: 700;
    line-height: 1.6;
    resize: vertical;
}

.vocabulary-picker-flow-editor[readonly] {
    cursor: default;
    resize: none;
}

.collection-chapter-edit-page > [class*="col-"] {
    max-width: none;
}

.collection-chapter-edit-shell {
    width: 100%;
    max-width: none;
}

.collection-chapter-edit-page form {
    max-width: none;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.collection-chapter-basics-grid,
.collection-chapter-text-grid,
.collection-chapter-edit-content-grid,
.collection-chapter-test-word-grid,
.collection-chapter-support-grid {
    display: grid;
    gap: 1rem;
}

.collection-chapter-basics-grid {
    grid-template-columns: minmax(16rem, 1fr) minmax(8rem, 0.5fr) minmax(22rem, 2fr);
}

.collection-chapter-text-grid,
.collection-chapter-support-grid {
    align-items: start;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.collection-chapter-edit-content-grid {
    --collection-chapter-edit-panel-height: 30rem;
    align-items: stretch;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
}

.collection-chapter-test-word-grid {
    align-items: stretch;
    grid-template-columns: minmax(0, 2.2fr) minmax(18rem, 0.8fr);
    margin-top: 1.1rem;
}

.test-words-preparation-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0 0.45rem;
}

.test-words-preparation-title {
    color: var(--bs-primary);
    font-size: 1.35rem;
    font-weight: 800;
}

.test-words-preparation-panel {
    padding: 1rem;
    border: 2px solid rgba(var(--bs-primary-rgb), 0.22);
    border-radius: 8px;
    background: rgba(var(--bs-primary-rgb), 0.055);
}

.test-words-preparation-instructions {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-left: 4px solid var(--bs-primary);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.78);
}

.test-words-preparation-instructions ol {
    margin-bottom: 0.65rem;
    padding-left: 1.4rem;
}

.test-words-preparation-instructions p:last-child {
    margin-bottom: 0;
}

.collection-chapter-basics-grid > .form-group,
.collection-chapter-text-grid > .form-group,
.collection-chapter-edit-content-grid > .form-group,
.collection-chapter-test-word-grid > .form-group,
.collection-chapter-support-grid > .form-group {
    min-width: 0;
}

.collection-chapter-edit-content-section {
    display: grid;
    grid-template-rows: auto var(--collection-chapter-edit-panel-height);
    align-content: start;
    min-height: 0;
    margin-bottom: 0;
}

.collection-chapter-edit-section-title {
    position: relative;
    display: inline-block;
    align-self: flex-start;
    margin: 0 0 1rem;
    color: var(--bs-primary);
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.2;
}

.collection-chapter-edit-section-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background-color: var(--bs-primary);
    opacity: 0.3;
}

.collection-heading-with-help {
    cursor: help;
}

.collection-heading-help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.05rem;
    height: 1.05rem;
    margin-left: 0.35rem;
    border-radius: 50%;
    color: #fff;
    background: var(--bs-primary);
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1;
    vertical-align: 0.12rem;
}

.collection-heading-help-bubble {
    position: absolute;
    left: 0;
    bottom: calc(100% + 0.6rem);
    z-index: 20;
    width: max-content;
    max-width: min(24rem, calc(100vw - 2rem));
    padding: 0.55rem 0.7rem;
    border: 2px solid rgba(var(--bs-primary-rgb), 0.25);
    border-radius: 6px;
    color: #172033;
    background: #fff;
    box-shadow: 0 0.65rem 1.4rem rgba(24, 37, 61, 0.18);
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.3;
    opacity: 0;
    pointer-events: none;
    transform: translateY(0.25rem);
    transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
    visibility: hidden;
    white-space: normal;
}

.collection-heading-help-bubble::after {
    content: "";
    position: absolute;
    left: 1rem;
    top: 100%;
    border: 0.45rem solid transparent;
    border-top-color: #fff;
}

.collection-heading-with-help:hover .collection-heading-help-bubble,
.collection-heading-with-help:focus .collection-heading-help-bubble,
.collection-heading-with-help:focus-within .collection-heading-help-bubble {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.collection-page.collection-chapter-edit-shell .collection-chapter-edit-section-title,
.collection-page.collection-chapter-edit-shell label.control-label.collection-chapter-edit-section-title {
    position: relative;
    display: inline-block;
    align-self: flex-start;
    margin: 0 0 1rem;
    color: var(--bs-primary);
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.2;
}

.collection-chapter-edit-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
}

.collection-heading-with-options {
    justify-content: flex-start;
    gap: 1rem;
}

.collection-heading-with-options .vocabulary-batch-toolbar {
    justify-content: flex-start;
}

.collection-test-word-definitions-heading {
    margin-top: 1.75rem;
}

.collection-test-word-definitions {
    margin-top: 0;
}

.collection-phrase-select-button {
    flex: 0 0 auto;
    min-height: 2.25rem;
    font-weight: 700;
}

.collection-phrase-select-button.active {
    color: #fff;
    background: var(--bs-primary);
    border-color: var(--bs-primary);
}

.collection-chapter-edit-content-section textarea.form-control {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    min-height: 0;
    resize: none;
}

.chapter-text-highlight-shell {
    position: relative;
    height: 100%;
    min-height: 0;
}

.chapter-text-highlight-shell textarea.form-control {
    position: relative;
    z-index: 1;
    background: transparent;
}

.chapter-text-highlight-layer {
    position: absolute;
    inset: 0;
    z-index: 0;
    box-sizing: border-box;
    overflow: hidden;
    border: 1px solid transparent;
    color: transparent;
    background: #fff;
    pointer-events: none;
    white-space: pre-wrap;
}

.chapter-text-highlight-shell.is-editing .chapter-text-highlight-layer {
    visibility: hidden;
}

.chapter-text-highlight-shell.is-selecting-phrase textarea.form-control {
    color: transparent;
    -webkit-text-fill-color: transparent;
    caret-color: transparent;
    pointer-events: none;
}

.chapter-text-highlight-shell.is-selecting-phrase .chapter-text-highlight-layer {
    z-index: 2;
    overflow: auto;
    color: #2f3846;
    pointer-events: auto;
    visibility: visible;
}

.chapter-text-phrase-highlight {
    color: #2f3846;
    padding: 0;
    background: transparent;
    text-shadow: none;
    text-decoration-line: underline;
    text-decoration-style: dotted;
    text-decoration-color: #d12d2d;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.16em;
}

.chapter-text-selected-highlight {
    color: #253248;
    padding: 0;
    font-weight: 900;
    background: transparent;
}

.chapter-text-phrase-highlight.chapter-text-selected-highlight {
    color: #253248;
    font-weight: 900;
    background: transparent;
    text-shadow: none;
}

.chapter-text-selection-builder-highlight {
    color: #172033;
    padding: 0;
    border-radius: 3px;
    background: rgba(103, 194, 115, 0.3);
    box-shadow: inset 0 -2px 0 rgba(43, 145, 61, 0.55);
}

.chapter-text-selectable-word {
    border-radius: 3px;
    cursor: pointer;
}

.chapter-text-selectable-word:hover,
.chapter-text-selectable-word:focus {
    outline: 2px solid rgba(var(--bs-primary-rgb), 0.45);
    outline-offset: 1px;
    background: rgba(var(--bs-primary-rgb), 0.08);
}

.collection-phrase-selection-panel {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.65rem;
    padding: 0.65rem;
    border: 2px solid rgba(var(--bs-primary-rgb), 0.18);
    border-radius: 6px;
    background: #f8faff;
}

.collection-phrase-selection-panel[hidden],
.collection-custom-phrase-backdrop[hidden],
.collection-custom-phrase-dialog[hidden],
.collection-custom-phrase-status[hidden],
.collection-phrase-selection-preview[hidden] {
    display: none !important;
}

.collection-phrase-selection-status {
    color: #253248;
    font-weight: 700;
}

.collection-phrase-selection-preview {
    max-width: 100%;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    color: #172033;
    background: rgba(103, 194, 115, 0.18);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.collection-custom-phrase-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(16, 24, 40, 0.36);
}

.collection-custom-phrase-dialog {
    position: fixed;
    left: 50%;
    bottom: max(1rem, env(safe-area-inset-bottom));
    z-index: 1051;
    width: min(34rem, calc(100vw - 1.5rem));
    max-height: calc(100vh - 2rem);
    padding: 1rem;
    overflow: auto;
    transform: translateX(-50%);
    border: 2px solid rgba(var(--bs-primary-rgb), 0.22);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1.2rem 2.5rem rgba(16, 24, 40, 0.26);
}

.collection-custom-phrase-dialog-header,
.collection-custom-phrase-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.collection-custom-phrase-dialog-title {
    margin: 0;
    color: var(--bs-primary);
    font-size: 1.25rem;
    font-weight: 800;
}

.collection-custom-phrase-close {
    min-width: 2.25rem;
    min-height: 2.25rem;
    padding: 0;
    color: #253248;
    font-size: 1.6rem;
    line-height: 1;
    text-decoration: none;
}

.collection-custom-phrase-field {
    margin-top: 0.8rem;
}

.collection-custom-phrase-field label,
.collection-custom-phrase-check {
    color: #253248;
    font-weight: 700;
}

.collection-custom-phrase-check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.9rem 0 0;
}

.collection-custom-phrase-status {
    margin-top: 0.7rem;
    font-weight: 700;
}

.collection-custom-phrase-actions {
    justify-content: flex-end;
    margin-top: 1rem;
}

.collection-chapter-edit-content-section .field-validation-valid {
    display: none;
}

.collection-chapter-edit-content-section .field-validation-error {
    display: block;
    margin-top: 0.35rem;
}

.collection-chapter-edit-content-grid .collection-recorder-panel {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    height: 100%;
    min-height: 0;
    overflow: auto;
    padding: 0.7rem 0.8rem;
    color: #2f3846;
    background: #fff;
    border-color: rgba(var(--bs-primary-rgb), 0.18);
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.55;
}

.collection-chapter-edit-content-grid .collection-recorder-panel audio {
    display: block;
    width: 100%;
    min-width: 0;
}

.collection-chapter-edit-content-grid .collection-recorder-panel .collection-current-audio-preview {
    display: grid;
    gap: 0.35rem;
    margin-bottom: 0.65rem;
}

.collection-chapter-edit-content-grid .collection-recorder-panel .collection-current-audio-preview[hidden] {
    display: none;
}

.collection-chapter-edit-content-grid .collection-recorder-panel .collection-current-audio-label {
    color: #344054;
    font-size: 0.95rem;
    font-weight: 800;
}

.collection-chapter-edit-content-grid .collection-recorder-panel .form-check-label,
.collection-chapter-edit-content-grid .collection-recorder-panel .text-muted {
    font-weight: 600;
}

.collection-chapter-edit-content-grid .collection-recorder-panel .collection-recording-actions-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    column-gap: 1.6rem;
    row-gap: 0.7rem;
    align-items: center;
    margin-top: 0.65rem;
}

.collection-chapter-edit-content-grid .collection-recorder-panel .collection-recording-button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-start;
}

.collection-chapter-edit-content-grid .collection-recorder-panel .collection-recording-option-stack {
    display: grid;
    gap: 0.25rem;
    justify-items: start;
    min-width: 0;
}

.collection-chapter-edit-content-grid .collection-recorder-panel .collection-recording-option-stack .form-check {
    margin-bottom: 0;
}

.collection-chapter-edit-content-grid .collection-recorder-panel .form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.55rem;
    padding-top: 0;
}

.collection-chapter-edit-content-grid .collection-recorder-panel #audioFileUpload {
    flex: 1 1 12rem;
    min-width: 0;
}

.collection-chapter-edit-content-grid .collection-recorder-panel .collection-delete-audio-button {
    align-self: flex-start;
    margin-top: 0.15rem;
    padding: 0;
    color: #7a8394;
    font-size: 0.9rem;
    font-weight: 650;
    text-decoration: none;
}

.collection-chapter-edit-content-grid .collection-recorder-panel .collection-delete-audio-button:hover,
.collection-chapter-edit-content-grid .collection-recorder-panel .collection-delete-audio-button:focus {
    color: #b4232c;
    text-decoration: underline;
    outline: none;
}

.collection-chapter-selected-words {
    display: flex;
    flex-direction: column;
}

.collection-chapter-selected-words .vocabulary-picker-flow-editor {
    flex: 0 0 auto;
    min-height: 2.4rem;
}

.collection-chapter-support-grid .modern-form-section {
    margin-top: 0;
}

.collection-chapter-audio-section {
    min-width: 0;
    order: 1;
}

.collection-chapter-associated-section {
    order: 2;
}

.collection-chapter-support-grid > .modern-form-section:only-child {
    grid-column: 1 / -1;
}

.collection-chapter-missing-lexicon-section {
    margin-top: 1rem;
}

.missing-lexicon-word-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
}

.missing-lexicon-word-row {
    --missing-lexicon-control-height: 2.5rem;
    display: grid;
    grid-template-columns: minmax(7rem, 14rem) auto max-content minmax(18rem, 1fr) minmax(12rem, 0.7fr);
    gap: 0.55rem;
    align-items: center;
    padding: 0.55rem;
    border: 1px solid rgba(var(--bs-primary-rgb), 0.18);
    border-radius: 5px;
    background: #fff;
}

.missing-lexicon-word-row.is-add-word-mode {
    grid-template-columns: minmax(7rem, 14rem) auto minmax(14rem, 0.55fr) minmax(24rem, 1.45fr);
}

.missing-lexicon-word-row.has-recommendation {
    grid-template-columns: minmax(7rem, 14rem) auto minmax(42rem, 2.15fr) minmax(12rem, 0.55fr);
}

.missing-lexicon-word-row.is-proper-name-mode {
    grid-template-columns: minmax(7rem, 14rem) auto max-content minmax(14rem, 0.65fr) minmax(22rem, 1.35fr);
}

.missing-lexicon-word-row > * {
    align-self: center;
}

.missing-lexicon-word-text {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: var(--missing-lexicon-control-height);
    min-height: var(--missing-lexicon-control-height);
    padding: 0;
    border: 0;
    background: transparent;
    color: #2f3846;
    font: inherit;
    font-weight: 800;
    text-align: left;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.missing-lexicon-word-text:hover,
.missing-lexicon-word-text:focus {
    color: var(--bs-primary);
    text-decoration: underline;
}

.missing-lexicon-word-text:focus-visible {
    outline: 2px solid rgba(var(--bs-primary-rgb), 0.45);
    outline-offset: 2px;
}

.missing-lexicon-root-input {
    min-width: 0;
}

.missing-lexicon-word-row:not(.is-add-word-mode):not(.is-proper-name-mode) .missing-lexicon-root-input,
.missing-lexicon-word-row:not(.is-add-word-mode):not(.is-proper-name-mode) .missing-lexicon-expansion-input {
    grid-column: 4 / -1;
}

.missing-lexicon-option-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 0 1rem;
    align-items: center;
    align-self: center;
    height: var(--missing-lexicon-control-height);
    min-height: var(--missing-lexicon-control-height);
    min-width: 0;
    transform: translateY(0.95rem);
}

.missing-lexicon-option-list.has-recommendation {
    gap: 0 0.75rem;
    flex-wrap: nowrap;
    overflow: visible;
}

.missing-lexicon-option {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    height: var(--missing-lexicon-control-height);
    margin: 0;
    color: #2f3846;
    line-height: normal;
    font-weight: 700;
    white-space: nowrap;
}

.missing-lexicon-option-checkbox {
    flex: 0 0 auto;
    margin: 0 0.42rem 0 0;
    width: 1rem;
    height: 1rem;
}

.missing-lexicon-option-text {
    display: inline-block;
    line-height: normal;
    transform: translateY(-0.04rem);
}

.missing-lexicon-recommendation {
    margin-left: 1.4rem;
    color: #198754;
    font-size: 0.88rem;
    font-weight: 700;
    position: relative;
    top: -0.85rem;
}

.missing-lexicon-add-word-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    height: var(--missing-lexicon-control-height);
    min-height: var(--missing-lexicon-control-height);
    padding: 0 0.65rem;
    border-width: 1px;
    font-size: 0.9rem;
    font-weight: 750;
    white-space: nowrap;
}

.missing-lexicon-add-word-button.active {
    color: #fff;
    border-color: var(--bs-primary);
    background: var(--bs-primary);
}

.missing-lexicon-root-input,
.missing-lexicon-expansion-input,
.missing-lexicon-proper-name-input,
.missing-lexicon-part-of-speech-select,
.missing-lexicon-definition-input {
    align-self: center;
    min-height: var(--missing-lexicon-control-height);
    min-width: 0;
}

.missing-lexicon-kaikki-panel {
    grid-column: 1 / -1;
    display: grid;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid #d7e2ef;
    border-radius: 6px;
    background: #f7fbff;
}

.missing-lexicon-kaikki-heading {
    font-size: 0.82rem;
    font-weight: 700;
    color: #3a4f63;
}

.missing-lexicon-kaikki-guidance {
    margin-top: -0.25rem;
    font-size: 0.78rem;
    line-height: 1.35;
    color: #5c6b7a;
}

.missing-lexicon-kaikki-candidate {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: start;
    padding-top: 0.5rem;
    border-top: 1px solid #dde7f1;
}

.missing-lexicon-kaikki-candidate:first-of-type {
    padding-top: 0;
    border-top: 0;
}

.missing-lexicon-kaikki-candidate.is-merged {
    opacity: 0.78;
}

.missing-lexicon-kaikki-body {
    min-width: 0;
}

.missing-lexicon-kaikki-meta {
    font-size: 0.76rem;
    font-weight: 700;
    color: #5f6f7f;
}

.missing-lexicon-kaikki-definition {
    margin-top: 0.15rem;
    font-size: 0.9rem;
    line-height: 1.35;
    color: #27313a;
    overflow-wrap: anywhere;
}

.missing-lexicon-kaikki-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.25rem;
    font-size: 0.78rem;
}

.missing-lexicon-kaikki-attribution {
    margin-top: 0.25rem;
    font-size: 0.76rem;
    line-height: 1.3;
    color: #5d6d7d;
    overflow-wrap: anywhere;
}

.missing-lexicon-kaikki-actions {
    display: grid;
    gap: 0.25rem;
    justify-items: end;
    min-width: 10.5rem;
}

.missing-lexicon-kaikki-merge-button {
    width: 100%;
    min-height: 2.25rem;
    white-space: normal;
}

.missing-lexicon-kaikki-status {
    max-width: 12rem;
    font-size: 0.76rem;
    line-height: 1.25;
    color: #52616f;
    text-align: right;
}

.collection-chapter-text-grid textarea.form-control,
.collection-chapter-edit-content-grid textarea.form-control {
    min-width: 0;
    color: #2f3846;
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.68;
}

.test-word-definition-list {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.test-word-definition-item {
    display: grid;
    grid-template-columns: minmax(7rem, 0.7fr) minmax(15rem, 1.45fr) minmax(15rem, 1.45fr) minmax(7rem, auto);
    gap: 0.55rem;
    align-items: start;
    padding: 0.55rem;
    border: 1px solid rgba(var(--bs-primary-rgb), 0.18);
    border-radius: 5px;
    background: #fff;
}

.test-word-definition-item.test-word-definition-source-disabled {
    border-color: #e6c45c;
    background: #fff8d8;
    box-shadow: 0 0 0 1px rgba(184, 134, 11, 0.08);
}

.test-word-definition-source-warning {
    flex-basis: 100%;
    color: #7a5200;
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.25;
}

.test-word-definition-list-readonly .test-word-definition-item {
    grid-template-columns: minmax(7rem, 0.75fr) minmax(12rem, 1.25fr) minmax(10rem, 1fr);
}

.test-word-definition-list-readonly .test-word-definition-header > div:last-child {
    justify-self: start;
    text-align: left;
}

.test-word-definition-header {
    background: transparent;
    border-color: transparent;
    color: #253248;
    font-size: 0.9rem;
    font-weight: 800;
    padding-bottom: 0;
}

.test-word-definition-header > div:last-child {
    justify-self: center;
    text-align: center;
}

.test-word-definition-term {
    align-items: center;
    color: var(--bs-primary);
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    font-weight: 800;
    padding-top: 0.25rem;
}

.test-word-definition-native {
    align-items: center;
    color: #253248;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    font-weight: 700;
    padding-top: 0.25rem;
}

.test-word-definition-english {
    align-items: baseline;
    color: #253248;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    font-weight: 600;
    overflow-wrap: anywhere;
    padding-top: 0.25rem;
}

.test-word-definition-inline-source-code {
    color: #667085;
    font-family: var(--bs-font-monospace);
    font-size: 0.75rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.vocabulary-audio-button {
    align-items: center;
    background: var(--bs-primary);
    border: 0;
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.85rem;
    height: 1.55rem;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 1.55rem;
}

.vocabulary-audio-button:hover,
.vocabulary-audio-button:focus {
    background: #2f5bd4;
    color: #fff;
    outline: none;
}

.test-word-definition-muted {
    color: #667085;
    padding-top: 0.25rem;
}

.test-word-definition-picker {
    min-width: 0;
}

.test-word-definition-toggle {
    font-weight: 700;
    white-space: nowrap;
}

.test-word-definition-picker-summary {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.test-word-definition-option-count,
.test-word-definition-option-sources {
    color: #667085;
    font-family: var(--bs-font-monospace);
    font-size: 0.78rem;
    font-weight: 600;
}

.test-word-definition-option-sources {
    overflow-wrap: anywhere;
}

.test-word-definition-picker-summary + .test-word-definition-choice-list {
    margin-top: 0.45rem;
}

.test-word-definition-choice-list {
    display: grid;
    gap: 0.35rem;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.test-word-definition-lookup-term {
    color: #475467;
    font-size: 0.9rem;
    font-weight: 600;
    grid-column: 1 / -1;
}

.test-word-definition-lookup-term strong {
    color: #253248;
}

.test-word-definition-lookup-button {
    font-weight: 700;
    vertical-align: baseline;
}

.test-word-definition-lookup-button:focus-visible {
    outline: 2px solid rgba(var(--bs-primary-rgb), 0.45);
    outline-offset: 2px;
}

.test-word-definition-action {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
    justify-self: stretch;
}

.test-word-definition-choice {
    align-items: flex-start;
    border: 1px solid rgba(var(--bs-primary-rgb), 0.18);
    border-radius: 5px;
    color: #253248;
    display: flex;
    gap: 0.45rem;
    line-height: 1.35;
    margin: 0;
    padding: 0.45rem 0.55rem;
    white-space: normal;
}

.test-word-definition-choice input {
    flex: 0 0 auto;
    margin-top: 0.25rem;
}

.test-word-definition-choice-body {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.test-word-definition-choice-label {
    margin: 0;
    cursor: pointer;
}

.test-word-definition-choice-native {
    font-weight: 700;
}

.test-word-definition-native-line {
    align-items: center;
    display: inline-flex;
    gap: 0.18rem;
    max-width: 100%;
    min-width: 0;
    vertical-align: text-bottom;
}

.test-word-definition-native-line .test-word-definition-choice-native {
    min-width: 0;
    overflow-wrap: anywhere;
}

.test-word-definition-native-line .test-word-definition-choice-audio-button {
    flex: 0 0 auto;
}

.test-word-definition-choice-source-code {
    color: #667085;
    flex: 0 0 auto;
    font-family: var(--bs-font-monospace);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.test-word-definition-choice-audio-button {
    width: 1.35rem;
    height: 1.35rem;
    margin: 0 0.12rem;
    font-size: 0.72rem;
    vertical-align: text-bottom;
}

.test-word-definition-choice-english {
    font-weight: 600;
}

.test-word-definition-custom-choice {
    align-items: center;
}

.test-word-definition-custom-definition-choice {
    align-items: flex-start;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
}

.test-word-definition-custom-choice input[type="radio"] {
    margin-top: 0;
}

.test-word-definition-custom-label {
    flex: 0 0 auto;
    font-weight: 700;
    margin-top: 0.2rem;
}

.test-word-definition-custom-entry {
    display: grid;
    flex: 1 1 100%;
    gap: 0.45rem;
    grid-column: 1 / -1;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    margin-top: 0.15rem;
    min-width: 0;
}

.test-word-definition-lexicon-choice-list {
    display: grid;
    gap: 0.35rem;
    grid-column: 1 / -1;
}

.test-word-definition-lexicon-choice-list[hidden] {
    display: none !important;
}

.test-word-definition-lexicon-choice {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
}

.test-word-definition-lexicon-choice .test-word-definition-choice-body {
    align-self: center;
    display: grid;
    gap: 0.2rem;
}

.test-word-definition-lexicon-meta {
    color: #667085;
    font-size: 0.86rem;
    font-weight: 700;
    margin-left: 0.2rem;
}

.test-word-definition-lexicon-native-entry {
    align-items: center;
    display: grid;
    gap: 0.4rem;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    min-width: 0;
}

.test-word-definition-conditional-custom-fields[hidden] {
    display: none !important;
}

.test-word-definition-custom-field {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    min-width: 0;
}

.test-word-definition-custom-field-label {
    color: #475467;
    font-size: 0.78rem;
    font-weight: 700;
    margin: 0;
}

.test-word-definition-custom-input {
    flex: 1 1 12rem;
    min-width: 0;
    width: 100%;
}

.test-word-definition-sort {
    align-items: center;
    background: transparent;
    border: 0;
    color: inherit;
    display: inline-flex;
    font: inherit;
    gap: 0.35rem;
    padding: 0;
    text-align: left;
}

.test-word-definition-sort:hover,
.test-word-definition-sort:focus-visible {
    color: var(--bs-primary);
}

.test-word-definition-sort:focus-visible {
    outline: 2px solid rgba(var(--bs-primary-rgb), 0.4);
    outline-offset: 3px;
}

.test-word-definition-sort i {
    font-size: 0.75rem;
}

.test-word-definition-cell {
    min-width: 0;
}

.test-word-definition-current-line {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    min-height: 1.8rem;
    overflow-wrap: anywhere;
}

.test-word-definition-current-line .test-word-definition-native,
.test-word-definition-current-line .test-word-definition-english,
.test-word-definition-current-line .test-word-definition-muted {
    display: inline;
    padding-top: 0;
}

.test-word-definition-picker {
    margin-top: 0.15rem;
}

.test-word-definition-save-status {
    color: #667085;
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    margin-top: 0.12rem;
}

.test-word-definition-save-status.is-saving {
    color: #475467;
}

.test-word-definition-save-status.is-saved {
    color: #18794e;
}

.test-word-definition-save-status.is-error {
    color: #b42318;
}

.test-word-definition-save-status[hidden] {
    display: none !important;
}

.test-word-definition-choice-list {
    grid-template-columns: minmax(0, 1fr);
}

.test-word-definition-choice-list[hidden],
.test-word-definition-choice[hidden] {
    display: none !important;
}

.test-word-definition-choice-button {
    background: #fff;
    text-align: left;
    width: 100%;
}

.test-word-definition-choice-button:hover,
.test-word-definition-choice-button:focus-visible {
    background: rgba(var(--bs-primary-rgb), 0.05);
    border-color: rgba(var(--bs-primary-rgb), 0.45);
}

.test-word-definition-custom-select {
    background: transparent;
    border: 0;
    color: var(--bs-primary);
    font-weight: 700;
    padding: 0;
    text-align: left;
}

.test-word-definition-cell .test-word-definition-custom-entry {
    grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 1000px) {
    .test-word-definition-item,
    .test-word-definition-list-readonly .test-word-definition-item {
        grid-template-columns: 1fr;
    }

    .test-word-definition-action,
    .test-word-definition-header > div:last-child {
        justify-content: flex-start;
        justify-self: start;
    }
}

@media (max-width: 900px) {
    .test-word-definition-item {
        grid-template-columns: 1fr;
    }

    .test-word-definition-lexicon-choice {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .test-word-definition-lexicon-native-entry {
        grid-column: 1 / -1;
    }

    .missing-lexicon-word-row,
    .missing-lexicon-word-row.is-add-word-mode,
    .missing-lexicon-word-row.has-recommendation,
    .missing-lexicon-word-row.is-proper-name-mode {
        grid-template-columns: 1fr;
    }

    .missing-lexicon-option-list {
        flex-wrap: wrap;
    }

    .missing-lexicon-option-list.has-recommendation {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .missing-lexicon-kaikki-candidate {
        grid-template-columns: 1fr;
    }

    .missing-lexicon-kaikki-actions {
        justify-items: stretch;
        min-width: 0;
    }

    .missing-lexicon-kaikki-status {
        max-width: none;
        text-align: left;
    }

    .test-word-definition-picker {
        min-width: 0;
    }

    .test-word-definition-action,
    .test-word-definition-header > div:last-child {
        justify-content: flex-start;
        justify-self: start;
    }
}

@media (max-width: 1200px) {
    .collection-chapter-basics-grid,
    .collection-chapter-text-grid,
    .collection-chapter-support-grid {
        grid-template-columns: 1fr;
    }

    .collection-chapter-test-word-grid {
        grid-template-columns: 1fr;
    }
}

.collection-page .collection-busy-status {
    margin-top: 0.9rem;
    margin-bottom: 0.55rem;
    color: #dc3545;
    font-size: 1.12rem;
    font-weight: 900;
    line-height: 1.25;
}

.collection-page .collection-operation-progress {
    position: relative;
    width: min(42rem, 100%);
    height: 0.75rem;
    margin: 0.35rem 0 0.9rem;
    overflow: hidden;
    border: 1px solid rgba(220, 53, 69, 0.45);
    border-radius: 999px;
    background: rgba(220, 53, 69, 0.12);
}

.collection-page .collection-operation-progress-bar {
    position: absolute;
    inset: 0 auto 0 0;
    width: 38%;
    border-radius: inherit;
    background: #dc3545;
    animation: collection-operation-progress-slide 1.05s ease-in-out infinite;
}

@keyframes collection-operation-progress-slide {
    0% {
        transform: translateX(-105%);
    }

    50% {
        transform: translateX(90%);
    }

    100% {
        transform: translateX(265%);
    }
}

.collection-page .collection-recorder-panel .btn,
.collection-page .collection-submit-button,
.collection-page .collection-danger-button {
    min-height: 2.7rem;
    border-width: 2px;
    border-radius: 6px;
    font-weight: 800;
}

.collection-page .collection-submit-button {
    min-width: 8rem;
    border-color: var(--bs-primary);
    color: white;
    background: var(--bs-primary);
}

.collection-page .collection-submit-button:disabled,
.collection-page .collection-submit-button:disabled:hover {
    border-color: rgba(108, 117, 125, 0.45);
    color: #6c757d;
    background: #e9ecef;
    transform: none;
    cursor: not-allowed;
}

.collection-page .collection-submit-button.collection-submit-button-dirty {
    box-shadow: 0 0 0 0.18rem rgba(240, 173, 78, 0.24);
}

.collection-page .collection-submit-button:hover {
    color: var(--bs-primary);
    background: white;
}

.collection-page .collection-danger-button {
    min-width: 8rem;
    border-color: #dc3545;
    color: white;
    background: #dc3545;
}

.collection-page .collection-danger-button:hover {
    color: #dc3545;
    background: white;
}

.collection-chapter-unsaved-indicator {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1050;
    display: none;
    width: min(22rem, calc(100vw - 2rem));
    padding: 0.65rem 0.85rem;
    border: 1px solid rgba(255, 193, 7, 0.45);
    border-left: 5px solid #f0ad4e;
    border-radius: 6px;
    color: #4d3900;
    background: #fff8e1;
    font-weight: 700;
    box-shadow: 0 0.25rem 0.9rem rgba(0, 0, 0, 0.16);
}

.collection-chapter-unsaved-indicator.is-visible {
    display: block;
}

.collection-chapter-unsaved-indicator[hidden] {
    display: none !important;
}

.collection-page .collection-empty-state {
    width: min(820px, 100%);
    padding: 1rem 1.2rem;
    border-left: 6px solid rgba(var(--bs-primary-rgb), 0.65);
    background: rgba(var(--bs-primary-rgb), 0.055);
    color: #46505c;
    font-size: 1.08rem;
    font-weight: 700;
}

.collection-page .collection-delete-warning {
    width: min(860px, 100%);
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-left: 6px solid #dc3545;
    background: rgba(220, 53, 69, 0.08);
    color: #9f1c2c;
    font-size: 1.08rem;
    font-weight: 800;
}

@media (max-width: 900px) {
    .collection-page .collection-detail-chapter-header {
        display: none;
    }

    .collection-page .collection-detail-chapter-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.45rem;
        align-items: start;
        margin-bottom: 0.75rem;
        padding: 0.85rem 0.75rem;
        border-bottom: 0;
        border-left: 4px solid rgba(var(--bs-primary-rgb), 0.3);
        background: rgba(var(--bs-primary-rgb), 0.035);
    }

    .collection-page .collection-detail-chapter-cell {
        display: grid;
        grid-template-columns: 7.5rem minmax(0, 1fr);
        gap: 0.75rem;
        align-items: start;
    }

    .collection-page .collection-detail-chapter-cell::before {
        content: attr(data-label);
        color: #667085;
        font-weight: 800;
    }

    .collection-page .collection-detail-chapter-cell .modern-table-actions {
        justify-content: flex-start;
    }

    .collection-page .collection-chapter-attachment-row,
    .collection-page .collection-chapter-upload-grid {
        grid-template-columns: 1fr;
    }

    .collection-page .collection-details-grid,
    .collection-page .collection-details-list,
    .collection-page .collection-summary-grid,
    .collection-page .collection-chapter-row {
        grid-template-columns: 1fr;
    }

    .collection-page .collection-details-list {
        row-gap: 0.2rem;
    }

    .collection-page .collection-value {
        margin-bottom: 0.8rem;
    }

    .collection-page .collection-chapter-list {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .modern-page-title {
        font-size: 2.1rem;
    }

    .modern-form-page form,
    .modern-details-panel dl.row,
    .modern-filter-panel form {
        padding: 1rem;
    }

    .modern-hero {
        padding: 1.25rem;
    }

    .modern-hero-actions,
    .modern-action-row {
        display: grid;
    }

    .modern-command-col {
        width: 190px;
    }

    .modern-table-actions {
        display: grid;
    }

    .modern-link-list,
    .modern-inline-list {
        display: grid;
    }
}
