:root {
    --ink: #172824;
    --muted: #63726e;
    --line: #d9e2de;
    --surface: #ffffff;
    --surface-soft: #f4f7f5;
    --page: #edf2ef;
    --brand: #176b54;
    --brand-dark: #0d4b3a;
    --brand-soft: #dff2e9;
    --gold: #b88328;
    --danger: #a33e34;
    --danger-soft: #f9e8e5;
    --shadow: 0 16px 38px rgba(20, 52, 43, .10);
    --radius: 8px;
    color-scheme: light;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    letter-spacing: 0;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    min-width: 320px;
    min-height: 100%;
    background: var(--page);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--page);
    font-size: 15px;
    line-height: 1.6;
    letter-spacing: 0;
}

button,
input {
    font: inherit;
    letter-spacing: 0;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

h1,
h2,
p {
    margin-top: 0;
}

h1,
h2 {
    line-height: 1.25;
    letter-spacing: 0;
}

h1 {
    margin-bottom: 8px;
    font-size: 28px;
}

h2 {
    margin-bottom: 6px;
    font-size: 20px;
}

.eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
}

.login-page {
    display: grid;
    grid-template-rows: 1fr auto;
    background-color: #d9e4df;
    background-image: linear-gradient(rgba(12, 43, 35, .24), rgba(12, 43, 35, .36)), url("../images/bg-academy-mountains.webp");
    background-position: center;
    background-size: cover;
}

.login-shell {
    width: min(1040px, calc(100% - 48px));
    min-height: 590px;
    margin: auto;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .62);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 24px 60px rgba(8, 33, 26, .24);
}

.login-brand {
    position: relative;
    min-width: 0;
    padding: 38px 42px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    color: #fff;
    background: #174f41;
}

.login-brand::after {
    position: absolute;
    right: -150px;
    bottom: -30px;
    width: 710px;
    height: 400px;
    content: "";
    pointer-events: none;
    background: url("../images/dragon-mascot.webp") center / contain no-repeat;
    opacity: .94;
}

.login-brand__mark,
.login-brand__copy {
    position: relative;
    z-index: 1;
}

.login-brand__mark {
    display: flex;
    align-items: center;
    gap: 12px;
}

.login-brand__mark img {
    width: 58px;
    height: 58px;
    object-fit: cover;
    object-position: 22% center;
    border: 2px solid rgba(255, 255, 255, .72);
    border-radius: 50%;
    background: #fff;
}

.login-brand__mark strong,
.login-brand__mark span {
    display: block;
}

.login-brand__mark strong {
    font-size: 23px;
}

.login-brand__mark span {
    color: rgba(255, 255, 255, .72);
    font-size: 10px;
}

.login-brand__copy {
    max-width: 420px;
    margin-bottom: 6px;
    text-shadow: 0 1px 14px rgba(0, 0, 0, .18);
}

.login-brand__copy p {
    margin-bottom: 8px;
    color: #d9eee6;
    font-weight: 700;
}

.login-brand__copy h1 {
    max-width: 360px;
    margin-bottom: 14px;
    font-size: 34px;
}

.login-brand__copy span {
    display: block;
    max-width: 310px;
    color: rgba(255, 255, 255, .82);
}

.login-panel {
    align-self: center;
    min-width: 0;
    padding: 50px 42px;
}

.login-panel__heading {
    margin-bottom: 26px;
}

.login-panel__heading h2 {
    margin-bottom: 6px;
    font-size: 27px;
}

.login-panel__heading p,
.login-panel__note {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 13px;
}

.login-form {
    display: grid;
    gap: 8px;
}

.login-form label {
    margin-top: 8px;
    color: #344a44;
    font-size: 13px;
    font-weight: 700;
}

.login-form input {
    width: 100%;
    height: 46px;
    padding: 0 13px;
    border: 1px solid #bdccc6;
    border-radius: 6px;
    outline: 0;
    color: var(--ink);
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.login-form input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(23, 107, 84, .13);
}

.primary-button {
    min-height: 48px;
    margin-top: 20px;
    padding: 0 20px;
    border: 0;
    border-radius: 6px;
    color: #fff;
    background: var(--brand);
    font-weight: 700;
    cursor: pointer;
}

.primary-button:hover {
    background: var(--brand-dark);
}

.form-error,
.flash {
    padding: 11px 13px;
    border: 1px solid #e3bcb7;
    border-radius: 6px;
    color: #7f3028;
    background: var(--danger-soft);
    font-size: 13px;
}

.study-waiting-state {
    min-height: 340px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.study-waiting-state h1 {
    max-width: 620px;
    margin-bottom: 12px;
}

.study-waiting-state p {
    max-width: 560px;
    color: var(--muted);
}

.study-waiting-actions {
    width: min(680px, 100%);
    margin-top: 18px;
    display: flex;
    align-items: end;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.study-waiting-actions form {
    margin: 0;
}

.study-waiting-actions > form > button {
    min-height: 44px;
}

.append-words-form {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
    text-align: left;
}

.append-words-form label {
    min-width: 120px;
    color: var(--muted);
    font-size: 13px;
}

.append-words-form select {
    display: block;
    width: 100%;
    height: 42px;
    margin-top: 4px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
}

.append-words-form .primary-button {
    margin-top: 0;
}

.append-words-quick {
    display: flex;
    align-items: end;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.append-words-quick label {
    min-width: 118px;
    color: var(--muted);
    font-size: 12px;
}

.append-words-quick select {
    display: block;
    width: 100%;
    height: 36px;
    margin-top: 4px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
}

.append-words-quick .secondary-button {
    width: auto;
    min-height: 36px;
    padding: 0 12px;
}

.table-action-group {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    min-width: 210px;
}

.table-action-group form {
    margin: 0;
}

.login-panel__note {
    margin-top: 24px;
    text-align: center;
}

.login-panel__note a,
.register-form__help {
    color: var(--brand);
}

.register-shell {
    grid-template-columns: minmax(0, .9fr) minmax(520px, 1.1fr);
}

.register-panel {
    padding-top: 30px;
    padding-bottom: 30px;
}

.register-panel .login-panel__heading {
    margin-bottom: 16px;
}

.register-form__row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.register-form__row label {
    display: grid;
    gap: 8px;
}

.login-form select {
    width: 100%;
    height: 46px;
    padding: 0 13px;
    border: 1px solid #bdccc6;
    border-radius: 6px;
    outline: 0;
    color: var(--ink);
    background: #fff;
}

.login-form select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(23, 107, 84, .13);
}

.register-form__help {
    margin: 4px 0 0;
    font-size: 12px;
}

.registration-trap {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.app-header {
    position: sticky;
    z-index: 20;
    top: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px);
}

.app-header__inner {
    width: min(1280px, calc(100% - 40px));
    min-height: 68px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 34px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
}

.brand img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    object-position: 22% center;
    border: 1px solid #c7d7d0;
    border-radius: 50%;
    background: var(--brand-soft);
}

.brand strong,
.brand small,
.account-menu strong,
.account-menu small {
    display: block;
    white-space: nowrap;
}

.brand strong {
    line-height: 1.2;
    font-size: 17px;
}

.brand small {
    color: var(--muted);
    font-size: 8px;
}

.app-nav {
    height: 68px;
    display: flex;
    align-items: stretch;
    gap: 22px;
}

.app-nav__link {
    position: relative;
    padding: 0 3px;
    display: flex;
    align-items: center;
    color: #52635e;
    font-weight: 650;
}

.app-nav__link::after {
    position: absolute;
    right: 2px;
    bottom: 0;
    left: 2px;
    height: 3px;
    content: "";
    background: transparent;
}

.app-nav__link.is-active {
    color: var(--brand);
}

.app-nav__link.is-active::after {
    background: var(--brand);
}

.account-menu {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.account-menu > span {
    max-width: 170px;
    text-align: right;
}

.account-menu strong,
.account-menu small {
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-menu strong {
    font-size: 13px;
}

.account-menu small {
    color: var(--muted);
    font-size: 11px;
}

.icon-text-button {
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 5px;
    color: #42534e;
    background: #fff;
    cursor: pointer;
}

.page-main {
    width: min(1280px, calc(100% - 40px));
    min-height: calc(100vh - 118px);
    margin: 0 auto;
    padding: 28px 0 42px;
}

.flash {
    margin-bottom: 18px;
}

.welcome-band,
.page-title-row {
    min-height: 136px;
    padding: 28px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    border: 1px solid #cedbd5;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 10px 28px rgba(30, 57, 49, .06);
}

.welcome-band p,
.page-title-row p {
    margin-bottom: 0;
    color: var(--muted);
}

.system-state,
.import-state {
    min-width: 210px;
    padding-left: 18px;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 9px;
    border-left: 1px solid var(--line);
}

.system-state .status-dot,
.import-state .status-dot {
    grid-row: span 2;
}

.system-state strong,
.system-state small,
.import-state strong,
.import-state small {
    display: block;
}

.system-state small,
.import-state small {
    color: var(--muted);
}

.system-state.is-pending .status-dot {
    background: #b27a24;
    box-shadow: 0 0 0 4px #f7ead2;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2d9a70;
    box-shadow: 0 0 0 4px #ddf3e9;
}

.stat-strip {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.stat-item {
    min-height: 88px;
    padding: 18px 22px;
    display: flex;
    align-items: baseline;
    gap: 9px;
    border-right: 1px solid var(--line);
}

.stat-item:last-child {
    border-right: 0;
}

.stat-item strong {
    font-size: 27px;
    line-height: 1;
}

.stat-item span {
    color: var(--muted);
}

.workspace-section,
.build-status,
.textbook-layout,
.import-detail,
.import-history,
.import-report-meta,
.import-report-issues {
    margin-top: 26px;
}

.section-heading {
    margin-bottom: 14px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
}

.section-heading h2 {
    margin-bottom: 0;
}

.section-note,
.section-heading > span,
.section-heading > div > span {
    color: var(--muted);
    font-size: 12px;
}

.section-heading.compact {
    min-height: 39px;
    margin: 0;
    padding: 0 0 13px;
    align-items: center;
    border-bottom: 1px solid var(--line);
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.student-module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.student-guidance-banner {
    margin-top: 18px;
    padding: 22px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border: 1px solid #dec796;
    border-radius: var(--radius);
    background: #fffaf0;
}

.student-guidance-banner h2 {
    margin: 2px 0 5px;
    font-size: 20px;
}

.student-guidance-banner p {
    margin: 0;
    color: var(--muted);
}

.student-guidance-banner .primary-button {
    margin: 0;
    flex: 0 0 auto;
}

.registration-setting {
    margin: 18px 0;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.registration-setting h2 {
    margin: 2px 0 4px;
    font-size: 18px;
}

.registration-setting p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.registration-setting form,
.registration-setting .primary-button,
.registration-setting .secondary-button {
    margin: 0;
    flex: 0 0 auto;
}

.temporary-password-banner {
    width: min(1280px, calc(100% - 40px));
    margin: 16px auto 0;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border: 1px solid #dfca99;
    border-radius: 6px;
    color: #6f571f;
    background: #fff8e7;
    font-size: 13px;
}

.temporary-password-banner span,
.temporary-password-banner strong {
    display: block;
}

.temporary-password-banner .secondary-button {
    flex: 0 0 auto;
}

.module-card {
    position: relative;
    min-height: 184px;
    padding: 23px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

a.module-card {
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

a.module-card:hover {
    transform: translateY(-2px);
    border-color: #a4c5b7;
    box-shadow: var(--shadow);
}

.module-card__index {
    margin-bottom: 18px;
    color: var(--gold);
    font-family: Georgia, serif;
    font-size: 12px;
    font-weight: 700;
}

.module-card strong {
    font-size: 18px;
}

.module-card p {
    margin: 6px 0 18px;
    color: var(--muted);
    font-size: 13px;
}

.module-card__action {
    margin-top: auto;
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
}

.module-card.is-pending {
    background: #f8faf9;
}

.module-card.is-pending .module-card__action {
    color: #87938f;
}

.build-status {
    padding: 26px 28px;
    display: grid;
    grid-template-columns: minmax(220px, .75fr) minmax(0, 1.25fr);
    gap: 40px;
    border-top: 1px solid #c9d6d0;
    border-bottom: 1px solid #c9d6d0;
}

.build-status ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.build-status li {
    padding: 9px 0;
    display: grid;
    grid-template-columns: 58px 1fr;
    align-items: baseline;
    gap: 11px;
    border-bottom: 1px solid var(--line);
}

.build-status li:last-child {
    border-bottom: 0;
}

.build-status li span {
    color: var(--gold);
    font-size: 12px;
    font-weight: 700;
}

.build-status li.is-done span {
    color: var(--brand);
}

.textbook-layout {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    align-items: start;
    gap: 18px;
}

.textbook-list,
.word-table-section {
    min-width: 0;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.textbook-item {
    margin-top: 10px;
    padding: 13px;
    display: block;
    border: 1px solid transparent;
    border-radius: 6px;
}

.textbook-item:hover,
.textbook-item.is-active {
    border-color: #bdd3ca;
    background: var(--brand-soft);
}

.textbook-item strong,
.textbook-item span,
.textbook-item small {
    display: block;
}

.textbook-item strong {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-height: 1.45;
}

.textbook-item span,
.textbook-item small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.content-badge {
    padding: 4px 8px;
    border: 1px solid #d7c69e;
    border-radius: 4px;
    color: #775d22 !important;
    background: #fff8e7;
    white-space: nowrap;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.data-table th,
.data-table td {
    padding: 13px 10px;
    border-bottom: 1px solid #e3e9e6;
    vertical-align: top;
    text-align: left;
    overflow-wrap: anywhere;
}

.data-table th {
    color: var(--muted);
    background: #f7f9f8;
    font-size: 12px;
    font-weight: 700;
}

.data-table th:nth-child(1) { width: 58px; }
.data-table th:nth-child(2) { width: 155px; }
.data-table th:nth-child(3) { width: 120px; }
.data-table th:nth-child(5) { width: 110px; }

.data-table tbody tr:hover {
    background: #f8fbf9;
}

.word-name,
.phonetic {
    display: block;
}

.word-name {
    color: var(--brand-dark);
    font-size: 16px;
}

.phonetic {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.meaning-cell {
    max-width: 0;
    line-height: 1.65;
}

.empty-state {
    min-height: 180px;
    display: grid;
    place-items: center;
    color: var(--muted);
}

.import-detail {
    padding: 20px 24px;
    display: grid;
    grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr);
    align-items: center;
    gap: 24px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.import-detail strong {
    overflow-wrap: anywhere;
}

.import-detail dl {
    margin: 0;
    display: grid;
    grid-template-columns: 1.3fr .6fr 1fr;
    gap: 18px;
}

.import-detail dl > div {
    min-width: 0;
}

.import-detail dt,
.import-detail dd {
    margin: 0;
}

.import-detail dt {
    color: var(--muted);
    font-size: 12px;
}

.import-detail dd {
    overflow-wrap: anywhere;
}

.import-history,
.import-report-issues {
    min-width: 0;
}

.import-history-table th:nth-child(1) { width: 225px; }
.import-history-table th:nth-child(2) { width: auto; }
.import-history-table th:nth-child(3) { width: 120px; }
.import-history-table th:nth-child(4) { width: 100px; }
.import-history-table th:nth-child(5) { width: 165px; }
.import-history-table th:nth-child(6) { width: 90px; }

.table-secondary {
    margin-top: 4px;
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.table-action,
.back-link {
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
}

.batch-status,
.issue-level {
    display: inline-flex;
    min-height: 26px;
    padding: 4px 8px;
    align-items: center;
    border: 1px solid #c8d7d1;
    border-radius: 4px;
    color: #355d4e;
    background: #edf6f2;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.batch-status--failed,
.issue-level--error {
    border-color: #e7b9b2;
    color: #943e34;
    background: #fff1ef;
}

.batch-status--rolled_back {
    border-color: #cfd2d1;
    color: #626b68;
    background: #f3f4f4;
}

.batch-status--running,
.batch-status--pending,
.issue-level--warning {
    border-color: #dfca99;
    color: #7a6023;
    background: #fff8e7;
}

.import-state--failed .status-dot {
    background: #b75043;
    box-shadow: 0 0 0 4px #fae4e0;
}

.import-state--rolled_back .status-dot {
    background: #7f8985;
    box-shadow: 0 0 0 4px #e6e9e8;
}

.import-report-title .back-link {
    margin-bottom: 14px;
    display: block;
}

.import-report-meta {
    padding: 20px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.import-report-meta dl {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.import-report-meta dt,
.import-report-meta dd {
    margin: 0;
}

.import-report-meta dt {
    color: var(--muted);
    font-size: 12px;
}

.import-report-meta dd {
    margin-top: 4px;
    overflow-wrap: anywhere;
}

.import-report-meta p {
    margin: 16px 0 0;
    color: var(--muted);
}

.import-issue-table th:nth-child(1) { width: 76px; }
.import-issue-table th:nth-child(2) { width: 76px; }
.import-issue-table th:nth-child(3) { width: 135px; }
.import-issue-table th:nth-child(4) { width: 230px; }
.import-issue-table th:nth-child(5) { width: auto; }

.import-issue-table code {
    color: #4d5f59;
    font-size: 11px;
    overflow-wrap: anywhere;
}

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

.app-footer {
    width: min(1280px, calc(100% - 40px));
    min-height: 50px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: #71807b;
    font-size: 11px;
}

.login-page .app-footer {
    color: rgba(255, 255, 255, .82);
}

@media (max-width: 900px) {
    .login-shell {
        grid-template-columns: 1fr 360px;
    }

    .register-shell {
        grid-template-columns: minmax(260px, .75fr) minmax(460px, 1.25fr);
    }

    .login-brand {
        padding: 28px;
    }

    .login-brand::after {
        right: -250px;
    }

    .login-panel {
        padding: 40px 30px;
    }

    .app-header__inner {
        gap: 20px;
    }

    .account-menu > span {
        display: none;
    }

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

    .textbook-layout {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .data-table th:nth-child(3),
    .data-table td:nth-child(3),
    .data-table th:nth-child(5),
    .data-table td:nth-child(5) {
        display: none;
    }

    .student-word-table th:nth-child(3),
    .student-word-table td:nth-child(3),
    .student-word-table th:nth-child(5),
    .student-word-table td:nth-child(5) {
        display: table-cell;
    }

    .student-management-table--teacher th:nth-child(3),
    .student-management-table--teacher td:nth-child(3) {
        display: table-cell;
    }

    .import-history-table th:nth-child(3),
    .import-history-table td:nth-child(3),
    .import-history-table th:nth-child(5),
    .import-history-table td:nth-child(5),
    .import-issue-table th:nth-child(3),
    .import-issue-table td:nth-child(3),
    .import-issue-table th:nth-child(5),
    .import-issue-table td:nth-child(5) {
        display: table-cell;
    }
}

@media (max-width: 767px) {
    h1 {
        font-size: 24px;
    }

    .login-page {
        display: block;
        padding: 0;
        background: #edf2ef;
    }

    .login-shell {
        width: 100%;
        min-height: calc(100vh - 42px);
        display: block;
        border: 0;
        box-shadow: none;
        background: #fff;
    }

    .login-brand {
        min-height: 228px;
        padding: 23px 24px;
        justify-content: flex-start;
    }

    .login-brand::after {
        right: -170px;
        bottom: -85px;
        width: 510px;
        height: 290px;
    }

    .login-brand__mark img {
        width: 48px;
        height: 48px;
    }

    .login-brand__copy {
        margin: 24px 0 0;
    }

    .login-brand__copy p,
    .login-brand__copy span {
        display: none;
    }

    .login-brand__copy h1 {
        max-width: 210px;
        margin: 0;
        font-size: 25px;
    }

    .login-panel {
        padding: 30px 24px 38px;
    }

    .login-panel__heading {
        margin-bottom: 18px;
    }

    .login-panel__heading h2 {
        font-size: 23px;
    }

    .register-form__row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .login-form input,
    .primary-button {
        min-height: 48px;
    }

    .app-header__inner {
        width: calc(100% - 24px);
        min-height: 60px;
        grid-template-columns: auto 1fr auto;
        gap: 12px;
    }

    .brand img {
        width: 36px;
        height: 36px;
    }

    .brand span,
    .account-menu > span {
        display: none;
    }

    .app-nav {
        height: 60px;
        justify-content: center;
        gap: 18px;
    }

    .app-nav__link {
        min-width: 44px;
        justify-content: center;
        font-size: 13px;
    }

    .icon-text-button {
        min-width: 44px;
        min-height: 44px;
        padding: 0 9px;
    }

    .page-main {
        width: calc(100% - 24px);
        padding: 18px 0 28px;
    }

    .welcome-band,
    .page-title-row {
        min-height: 0;
        padding: 20px;
        display: block;
    }

    .system-state,
    .import-state {
        min-width: 0;
        margin-top: 18px;
        padding: 14px 0 0;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .stat-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat-item {
        min-height: 72px;
        padding: 14px 16px;
        border-bottom: 1px solid var(--line);
    }

    .stat-item:nth-child(2n) {
        border-right: 0;
    }

    .stat-item strong {
        font-size: 23px;
    }

    .section-heading {
        align-items: center;
    }

    .section-note {
        display: none;
    }

    .module-grid {
        grid-template-columns: 1fr;
    }

    .student-guidance-banner {
        padding: 19px;
        align-items: stretch;
        flex-direction: column;
        gap: 14px;
    }

    .student-guidance-banner .primary-button {
        width: 100%;
    }

    .registration-setting {
        padding: 16px 0;
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .registration-setting button {
        width: 100%;
    }

    .temporary-password-banner {
        width: calc(100% - 24px);
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .module-card {
        min-height: 145px;
        padding: 19px;
    }

    .module-card__index {
        margin-bottom: 11px;
    }

    .build-status {
        padding: 22px 4px;
        display: block;
    }

    .build-status ol {
        margin-top: 14px;
    }

    .textbook-layout {
        display: block;
    }

    .textbook-list,
    .word-table-section {
        padding: 16px;
    }

    .word-table-section {
        margin-top: 14px;
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .data-table tr {
        padding: 15px 0;
        border-bottom: 1px solid var(--line);
    }

    .data-table td,
    .data-table td:nth-child(3),
    .data-table td:nth-child(5) {
        max-width: none;
        padding: 3px 0 3px 78px;
        display: block;
        border: 0;
    }

    .data-table td::before {
        float: left;
        width: 70px;
        margin-left: -78px;
        color: var(--muted);
        content: attr(data-label);
        font-size: 11px;
    }

    .meaning-cell {
        line-height: 1.55;
    }

    .import-detail {
        padding: 20px 4px;
        display: block;
    }

    .import-detail dl {
        margin-top: 14px;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .import-report-meta dl {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .import-report-title .batch-status {
        margin-top: 16px;
    }

    .app-footer {
        width: calc(100% - 24px);
        min-height: 42px;
    }

    .app-footer span:last-child {
        display: none;
    }

    .login-page .app-footer {
        color: var(--muted);
    }
}

@media (max-width: 359px) {
    .app-nav {
        gap: 8px;
    }

    .app-nav__link {
        padding: 0;
    }

    .stat-strip {
        grid-template-columns: 1fr;
    }

    .stat-item,
    .stat-item:nth-child(2n) {
        border-right: 0;
    }

    .section-heading.compact {
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

/* Phase 2: people, lesson planning and the shared study surface. */
.flash--success {
    border-color: #afd5c4;
    color: #15583f;
    background: #e6f5ed;
}

.admin-form-grid,
.course-prep-layout {
    margin-top: 22px;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
    gap: 18px;
    align-items: start;
}

.form-panel,
.plan-rule-panel,
.record-section,
.report-section {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.form-panel > label,
.form-grid-two > label {
    margin-top: 14px;
    display: grid;
    gap: 6px;
    color: #354b44;
    font-size: 13px;
    font-weight: 700;
}

.form-panel input,
.form-panel select {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 0 11px;
    border: 1px solid #bdccc6;
    border-radius: 5px;
    outline: 0;
    color: var(--ink);
    background: #fff;
}

.form-panel input:focus,
.form-panel select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(23, 107, 84, .12);
}

.form-grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 14px;
}

.compact-button {
    min-height: 44px;
    margin-top: 18px;
}

.lesson-plan-generate-button {
    display: block;
    margin-right: auto;
    margin-left: auto;
}

.form-help,
.plan-rule-panel p {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.segmented-field {
    margin: 16px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid #bdccc6;
    border-radius: 6px;
    overflow: hidden;
}

.segmented-field legend {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.segmented-field label {
    position: relative;
    min-width: 0;
    min-height: 44px;
    display: grid;
    place-items: center;
    border-right: 1px solid #bdccc6;
    cursor: pointer;
}

.segmented-field label:last-child {
    border-right: 0;
}

.segmented-field input {
    position: absolute;
    opacity: 0;
}

.segmented-field span {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #52635e;
    font-size: 13px;
    font-weight: 700;
}

.segmented-field input:checked + span {
    color: var(--brand-dark);
    background: var(--brand-soft);
}

.segmented-field--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.count-setting {
    margin-top: 14px;
}

.count-setting .count-mode-toggle,
.candidate-count-control .count-mode-toggle {
    margin-top: 0;
}

.count-setting__panel[hidden],
.candidate-count-control [data-count-panel][hidden],
.count-setting__message[hidden] {
    display: none;
}

.count-setting__message {
    margin: 8px 0 0;
    display: block;
    color: #8a5a13;
    font-size: 12px;
    line-height: 1.45;
}

.candidate-count-control {
    min-width: 180px;
    display: grid;
    gap: 7px;
}

.candidate-count-control .segmented-field label {
    min-width: 0;
    min-height: 32px;
}

.candidate-count-control .segmented-field span {
    font-size: 11px;
}

.candidate-count-control > label {
    min-width: 0;
}

.candidate-count-control input[type="number"] {
    display: block;
    width: 100%;
    height: 42px;
    margin-top: 4px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    background: var(--surface);
}

.free-practice-setup {
    margin-top: 18px;
}

.free-practice-form {
    width: min(760px, 100%);
}

.free-practice-start {
    width: 100%;
    min-height: 46px;
    margin-top: 18px;
}

.record-section {
    margin-top: 22px;
}

.record-list {
    display: grid;
}

.row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.row-actions form {
    margin: 0;
}

.plan-add-bar {
    margin-top: 22px;
    padding: 16px 18px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.plan-add-bar label {
    display: grid;
    gap: 6px;
    color: #354b44;
    font-size: 13px;
    font-weight: 700;
}

.plan-add-bar select,
.compact-select select {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 0 10px;
    border: 1px solid #bdccc6;
    border-radius: 5px;
    color: var(--ink);
    background: #fff;
}

.plan-adjust-toolbar {
    margin-top: 22px;
    padding: 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.plan-target-status {
    min-width: 220px;
    display: grid;
    grid-template-columns: auto auto;
    align-items: baseline;
    gap: 5px 12px;
}

.plan-target-status > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.plan-target-status > strong {
    color: var(--ink);
    font-size: 20px;
}

.plan-target-meter {
    grid-column: 1 / -1;
    height: 5px;
    overflow: hidden;
    border-radius: 3px;
    background: #dfe8e4;
}

.plan-target-meter span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--brand);
}

.plan-adjust-actions,
.plan-adjust-actions form {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.save-plan-button {
    min-height: 42px;
    margin: 0;
}

.plan-item-list {
    display: grid;
}

.plan-item-row {
    min-width: 0;
    padding: 14px 0;
    display: grid;
    grid-template-columns: 68px minmax(110px, .7fr) minmax(190px, 1.3fr) 80px 100px 88px 104px;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid #e2e9e6;
    transition: opacity .15s ease, background .15s ease;
}

.plan-item-row:last-child {
    border-bottom: 0;
}

.plan-item-row.is-excluded {
    opacity: .48;
}

.plan-item-row.is-dragging {
    opacity: .35;
    background: var(--brand-soft);
}

.plan-item-row.is-replacement {
    background: #f2f8f5;
    box-shadow: inset 3px 0 0 var(--brand);
}

.plan-item-row p {
    min-width: 0;
    margin: 0;
    color: #354b44;
    overflow-wrap: anywhere;
}

.plan-order-tools {
    display: grid;
    grid-template-columns: repeat(2, 30px);
    gap: 4px;
}

.plan-order-tools button {
    width: 30px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--brand-dark);
    background: #fff;
    cursor: pointer;
}

.plan-word strong,
.plan-word span {
    display: block;
    overflow-wrap: anywhere;
}

.plan-word strong {
    font-size: 17px;
}

.plan-word span,
.compact-select {
    color: var(--muted);
    font-size: 11px;
}

.source-chip {
    padding: 3px 7px;
    border: 1px solid #c7d7d0;
    border-radius: 4px;
    color: var(--brand-dark);
    background: var(--brand-soft);
    font-size: 11px;
    text-align: center;
}

.compact-select {
    display: grid;
    gap: 3px;
}

.include-toggle {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #354b44;
    font-size: 12px;
    cursor: pointer;
}

.include-toggle input {
    width: 18px;
    height: 18px;
    accent-color: var(--brand);
}

.replace-toggle {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #354b44;
    font-size: 12px;
    cursor: pointer;
}

.replace-toggle input,
.word-picker-result input {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    accent-color: var(--brand);
}

.has-word-picker {
    overflow: hidden;
}

.word-picker {
    position: fixed;
    inset: 0;
    z-index: 1200;
}

.word-picker[hidden] {
    display: none;
}

.word-picker__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(17, 28, 24, .42);
    cursor: default;
}

.word-picker__panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(680px, 100%);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    box-shadow: -12px 0 32px rgba(21, 42, 34, .16);
}

.word-picker__header {
    min-height: 82px;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
}

.word-picker__header h2 {
    margin: 3px 0 0;
    font-size: 22px;
}

.word-picker__close {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--ink);
    background: #fff;
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
}

.word-picker__filters {
    padding: 16px 22px;
    display: grid;
    grid-template-columns: minmax(150px, 1.5fr) minmax(120px, 1fr) minmax(120px, 1fr) auto;
    align-items: end;
    gap: 10px;
    border-bottom: 1px solid var(--line);
    background: #f8faf9;
}

.word-picker__filters label {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.word-picker__filters label > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.word-picker__filters input,
.word-picker__filters select {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0 10px;
    border: 1px solid #bdccc6;
    border-radius: 5px;
    color: var(--ink);
    background: #fff;
}

.word-picker__summary {
    min-height: 42px;
    padding: 10px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #edf1ef;
    color: var(--muted);
    font-size: 12px;
}

.word-picker__summary [role="alert"] {
    color: var(--danger);
    text-align: right;
}

.word-picker__results {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0 22px;
}

.word-picker-result {
    min-height: 76px;
    padding: 12px 4px;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #e6ece9;
    cursor: pointer;
}

.word-picker-result.is-selected {
    background: #f2f8f5;
}

.word-picker-result__body {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.word-picker-result__body strong {
    color: var(--ink);
    font-size: 17px;
    overflow-wrap: anywhere;
}

.word-picker-result__body span,
.word-picker-result__body small {
    color: var(--muted);
    font-size: 11px;
    overflow-wrap: anywhere;
}

.word-picker-result__body small {
    color: #354b44;
    font-size: 12px;
}

.word-picker-result__state {
    padding: 3px 7px;
    border: 1px solid #c7d7d0;
    border-radius: 4px;
    color: var(--brand-dark);
    background: var(--brand-soft);
    font-size: 11px;
    font-style: normal;
    white-space: nowrap;
}

.word-picker__empty {
    margin: 0;
    padding: 48px 0;
    color: var(--muted);
    text-align: center;
}

.word-picker__pagination {
    min-height: 48px;
    padding: 7px 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border-top: 1px solid var(--line);
}

.word-picker__pagination button {
    min-width: 76px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--brand-dark);
    background: #fff;
    cursor: pointer;
}

.word-picker__pagination button:disabled {
    opacity: .42;
    cursor: default;
}

.word-picker__pagination span {
    min-width: 64px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.word-picker__footer {
    min-height: 76px;
    padding: 14px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--line);
    background: #fff;
}

.word-picker__footer > div {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.word-picker__footer strong,
.word-picker__footer span {
    display: block;
    overflow-wrap: anywhere;
}

.word-picker__footer span {
    color: var(--muted);
    font-size: 12px;
}

.audit-list {
    display: grid;
}

.audit-row {
    min-width: 0;
    padding: 17px 0;
    display: grid;
    grid-template-columns: minmax(150px, .75fr) minmax(180px, 1fr) minmax(180px, 1fr) minmax(150px, .7fr);
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid #e2e9e6;
}

.audit-row:last-child {
    border-bottom: 0;
}

.audit-row > div,
.audit-row strong,
.audit-row span,
.audit-row small {
    min-width: 0;
}

.audit-row strong,
.audit-row span,
.audit-row small,
.audit-row time {
    display: block;
    overflow-wrap: anywhere;
}

.audit-row small,
.audit-row time,
.audit-row span {
    color: var(--muted);
    font-size: 12px;
}

.audit-row__action strong,
.audit-row__target strong {
    margin: 2px 0;
}

.role-badge {
    width: fit-content;
    margin-bottom: 5px;
    padding: 2px 7px;
    border: 1px solid #c6d6d0;
    border-radius: 4px;
    color: var(--brand-dark) !important;
    background: var(--brand-soft);
    font-size: 11px !important;
    font-weight: 700;
}

.role-badge--ordinary {
    border-color: #dcc99d;
    color: #735b22 !important;
    background: #fff8e7;
}

.student-row,
.plan-row {
    min-width: 0;
    padding: 15px 0;
    display: grid;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid #e2e9e6;
}

.student-row {
    grid-template-columns: 44px minmax(150px, 1.2fr) minmax(130px, 1fr) minmax(110px, .7fr) auto;
}

.plan-row {
    grid-template-columns: minmax(150px, 1.1fr) minmax(145px, 1fr) minmax(100px, .6fr) minmax(90px, .55fr) auto;
}

.student-row:last-child,
.plan-row:last-child {
    border-bottom: 0;
}

.student-row > div,
.plan-row > div {
    min-width: 0;
}

.student-row strong,
.student-row span,
.student-row small,
.plan-row strong,
.plan-row span,
.plan-row small {
    display: block;
}

.student-row span,
.plan-row span {
    overflow: hidden;
    color: #475b55;
    text-overflow: ellipsis;
}

.student-row small,
.plan-row small {
    color: var(--muted);
    font-size: 11px;
}

.student-avatar {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--brand);
    font-weight: 800;
}

.secondary-button,
.record-status {
    min-height: 38px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #b9cbc3;
    border-radius: 5px;
    color: var(--brand-dark);
    background: #fff;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.profile-list-actions {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-list-actions > form {
    display: inline-flex;
    margin: 0;
}

.profile-list-actions .primary-button,
.profile-list-actions .secondary-button {
    width: auto;
    height: 36px;
    min-height: 36px;
    margin: 0;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    font-size: 13px;
    line-height: 1;
}

@media (max-width: 720px) {
    .profile-list-actions .primary-button,
    .profile-list-actions .secondary-button {
        height: 44px;
        min-height: 44px;
    }
}

.finance-title-row {
    align-items: center;
}

.service-pair-price-list {
    display: grid;
    gap: 6px;
    margin: 12px 0;
}

.service-pair-price-list > span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}

.service-pair-price-list strong {
    color: var(--ink);
}

.finance-filter-bar {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr)) auto;
    align-items: end;
    gap: 10px;
    margin-bottom: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.finance-filter-bar label {
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
}

.finance-filter-bar input,
.finance-filter-bar select {
    width: 100%;
    min-height: 38px;
    margin-top: 5px;
}

.finance-summary-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.finance-summary-strip .stat-item {
    min-height: 92px;
}

.finance-summary-strip small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.finance-tabs {
    margin: 18px 0 12px;
}

.finance-table td {
    vertical-align: middle;
}

.finance-money {
    color: var(--brand-dark);
    font-weight: 700;
    white-space: nowrap;
}

.finance-money.is-negative {
    color: var(--danger);
}

@media (max-width: 1180px) {
    .finance-filter-bar {
        grid-template-columns: repeat(4, minmax(140px, 1fr));
    }
}

@media (max-width: 720px) {
    .finance-title-row {
        align-items: stretch;
    }

    .finance-filter-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .finance-filter-bar > button,
    .finance-filter-bar label:has(input[type="search"]) {
        grid-column: 1 / -1;
    }

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

    .finance-tabs {
        overflow-x: auto;
    }
}

.record-status {
    border-color: transparent;
    color: var(--muted);
    background: transparent;
    font-weight: 500;
}

.row-button {
    min-height: 40px;
    margin: 0;
    white-space: nowrap;
}

.student-selector {
    margin-top: 18px;
    padding-bottom: 4px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.course-assignment-filter {
    margin-top: 18px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
}

.course-assignment-filter h2,
.student-selection-block h2 {
    margin: 2px 0 0;
    font-size: 15px;
}

.course-assignment-filter form {
    width: min(560px, 65%);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.course-assignment-filter select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 5px;
    color: var(--brand-dark);
    background: #fff;
    font-weight: 700;
}

.student-selection-block {
    margin-top: 14px;
}

.student-selection-block .student-selector {
    margin-top: 8px;
}

.student-chip {
    min-width: 132px;
    min-height: 56px;
    padding: 8px 13px;
    display: grid;
    align-content: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    font-weight: 700;
}

.student-chip small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

.student-chip.is-active {
    border-color: #95bbaa;
    color: var(--brand-dark);
    background: var(--brand-soft);
}

.course-pair-summary {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface-soft);
}

.course-pair-summary div {
    min-width: 0;
    padding: 11px 13px;
}

.course-pair-summary div + div {
    border-left: 1px solid var(--line);
}

.course-pair-summary small,
.course-pair-summary strong {
    display: block;
}

.course-pair-summary small {
    color: var(--muted);
    font-size: 11px;
}

.course-conflict-note {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-left: 3px solid var(--danger);
    color: #7f2727;
    background: #fff2f0;
    font-size: 12px;
    font-weight: 700;
}

.primary-button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.active-course-panel {
    margin: 18px 0 0;
    border-color: #c8a95d;
}

.active-course-list {
    display: grid;
}

.active-course-row {
    min-width: 0;
    padding: 14px 0;
    display: grid;
    grid-template-columns: minmax(190px, .8fr) minmax(360px, 1.5fr) auto;
    align-items: center;
    gap: 16px;
    border-top: 1px solid var(--line);
}

.active-course-row__primary,
.active-course-row__primary strong,
.active-course-row__primary span {
    min-width: 0;
    display: block;
}

.active-course-row__primary span {
    margin-top: 3px;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.active-course-row__primary strong {
    overflow-wrap: anywhere;
}

.active-course-row__facts {
    min-width: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.active-course-row__facts div,
.active-course-row__facts dt,
.active-course-row__facts dd {
    min-width: 0;
    margin: 0;
}

.active-course-row__facts dt {
    color: var(--muted);
    font-size: 11px;
}

.active-course-row__facts dd {
    margin-top: 3px;
    overflow-wrap: anywhere;
    font-size: 12px;
    font-weight: 700;
}

.active-course-row__actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.active-course-row__actions form {
    margin: 0;
}

.danger-text {
    color: var(--danger);
    border-color: var(--danger);
}

.plan-rule-panel {
    min-height: 100%;
    background: #f7faf8;
}

.plan-rule-panel ol {
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.plan-rule-panel li {
    padding: 13px 0;
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: baseline;
    gap: 8px;
    border-bottom: 1px solid var(--line);
}

.plan-rule-panel li strong {
    color: var(--gold);
    font-family: Georgia, serif;
    font-size: 12px;
}

.report-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.report-mini-grid a {
    padding: 15px;
    display: grid;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.report-mini-grid span,
.report-mini-grid small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.student-record-sections,
.teacher-record-sections {
    margin-top: 18px;
    display: grid;
    gap: 18px;
}

.student-detail-header,
.teacher-detail-header {
    margin-bottom: 20px;
    padding: 12px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
}

.student-detail-actions,
.teacher-detail-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.student-detail-actions form,
.teacher-detail-actions form {
    margin: 0;
}

.student-profile-layout,
.teacher-profile-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 18px;
}

.curriculum-panel .section-heading {
    margin-bottom: 14px;
}

.curriculum-plan-list {
    display: grid;
    gap: 10px;
}

.curriculum-plan-row {
    min-width: 0;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.curriculum-plan-row:first-child {
    padding-top: 0;
}

.curriculum-plan-row:last-child {
    border-bottom: 0;
}

.curriculum-plan-row__heading,
.curriculum-plan-row__actions,
.curriculum-unit-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.curriculum-plan-row__heading {
    justify-content: space-between;
}

.curriculum-plan-row__heading > div {
    min-width: 0;
}

.curriculum-plan-row__heading strong,
.curriculum-plan-row__heading > div > span {
    display: block;
    overflow-wrap: anywhere;
}

.curriculum-plan-row__heading strong {
    font-size: 14px;
}

.curriculum-plan-row__heading > div > span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.curriculum-default-badge {
    flex: 0 0 auto;
    padding: 3px 7px;
    border: 1px solid #a8cbbd;
    border-radius: 4px;
    color: #15583f;
    background: #e6f5ed;
    font-size: 11px;
    font-weight: 800;
}

.curriculum-plan-row__facts {
    min-width: 0;
    margin: 10px 0 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
}

.curriculum-plan-row__facts div,
.curriculum-plan-row__facts dt,
.curriculum-plan-row__facts dd {
    min-width: 0;
    margin: 0;
}

.curriculum-plan-row__facts dt {
    color: var(--muted);
    font-size: 11px;
}

.curriculum-plan-row__facts dd {
    margin-top: 2px;
    overflow-wrap: anywhere;
    font-size: 12px;
    font-weight: 700;
}

.curriculum-plan-row__actions {
    margin-top: 12px;
    flex-wrap: wrap;
}

.curriculum-plan-row__links {
    margin-top: 9px;
}

.curriculum-plan-row__links a,
.student-word-result-heading a {
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 700;
}

.student-word-overview {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.student-word-overview > div {
    min-width: 0;
    padding: 15px 8px;
    text-align: center;
    border-right: 1px solid var(--line);
}

.student-word-overview > div:last-child {
    border-right: 0;
}

.student-word-overview strong,
.student-word-overview span {
    display: block;
}

.student-word-overview strong {
    font-size: 23px;
}

.student-word-overview span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.guided-curriculum-overview {
    margin-top: 18px;
    padding: 20px 22px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.guided-curriculum-list {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

.guided-curriculum-row {
    min-width: 0;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.guided-curriculum-row__heading,
.guided-curriculum-row__heading > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.guided-curriculum-row__heading strong,
.guided-curriculum-row__heading span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.guided-curriculum-row__heading strong {
    font-size: 14px;
}

.guided-curriculum-row__heading span {
    color: var(--muted);
    font-size: 11px;
}

.guided-curriculum-row progress {
    width: 100%;
    height: 8px;
    margin: 11px 0 8px;
    accent-color: var(--brand);
}

.guided-curriculum-row__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    color: var(--muted);
    font-size: 11px;
}

.word-status-cell strong,
.word-status-cell small,
.word-review-cell small {
    display: block;
}

.word-status-cell small,
.word-review-cell small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.word-source-cell {
    min-width: 150px;
    color: var(--muted);
    font-size: 12px;
}

.student-current-curriculum {
    margin-top: 18px;
    padding: 20px 22px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.student-current-curriculum__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.student-current-curriculum__heading h2 {
    margin: 3px 0 0;
    font-size: 18px;
}

.student-current-curriculum dl {
    margin: 16px 0 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.student-current-curriculum dt,
.student-current-curriculum dd {
    margin: 0;
}

.student-current-curriculum dt {
    color: var(--muted);
    font-size: 11px;
}

.student-current-curriculum dd {
    margin-top: 3px;
    overflow-wrap: anywhere;
    font-weight: 800;
}

.student-words-heading .secondary-button {
    width: auto;
}

.word-summary-strip {
    margin: 18px 0 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border: 1px solid var(--line);
    background: var(--surface);
}

.word-summary-strip a {
    min-width: 0;
    padding: 17px 18px;
    color: var(--ink);
    border-right: 1px solid var(--line);
}

.word-summary-strip a:last-child {
    border-right: 0;
}

.word-summary-strip dt,
.word-summary-strip dd {
    margin: 0;
}

.word-summary-strip dt {
    color: var(--muted);
    font-size: 12px;
}

.word-summary-strip dd {
    margin-top: 5px;
    font-size: 25px;
    font-weight: 800;
}

.student-word-records {
    margin-top: 0;
}

.student-word-result-heading {
    margin-bottom: 0;
}

.student-word-table th:nth-child(1) {
    width: 70px;
}

.student-word-table th:nth-child(2) {
    width: 210px;
}

.student-word-table th:nth-child(3) {
    width: 240px;
}

.student-word-table th:nth-child(4) {
    width: 150px;
}

.student-word-table th:nth-child(5) {
    width: 180px;
}

.student-word-table th:nth-child(6) {
    width: 110px;
}

.curriculum-plan-row__actions form {
    margin: 0;
}

.curriculum-plan-row__actions .secondary-button {
    width: auto;
    min-height: 36px;
    padding: 0 11px;
    font-size: 12px;
}

.curriculum-unit-form {
    min-width: min(100%, 260px);
}

.curriculum-unit-form label {
    min-width: 120px;
    flex: 1;
}

.curriculum-unit-form select {
    min-height: 36px;
}

.curriculum-enable-form {
    margin-top: 16px;
    padding-top: 4px;
    border-top: 1px solid var(--line);
}

.curriculum-default-check {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 8px !important;
    font-weight: 600 !important;
}

.curriculum-default-check input {
    width: 18px;
    min-height: 18px;
    margin: 0;
}

.curriculum-empty-note {
    margin-top: 0;
}

.paused-curriculum-list {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.paused-curriculum-list h3 {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 12px;
}

.paused-curriculum-row {
    padding: 9px 0;
    display: grid;
    grid-template-columns: minmax(150px, .8fr) minmax(210px, 1.2fr) auto;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
}

.paused-curriculum-row > div strong,
.paused-curriculum-row > div span {
    display: block;
}

.paused-curriculum-row > div span,
.paused-curriculum-row > span {
    color: var(--muted);
}

.paused-curriculum-row a {
    color: var(--brand-dark);
    font-weight: 700;
}

.teacher-summary-strip {
    margin: 0 0 18px;
}

.teacher-profile-layout {
    grid-template-columns: minmax(300px, .8fr) minmax(0, 1.2fr);
}

.teacher-student-list {
    display: grid;
    max-height: 430px;
    overflow-y: auto;
}

.teacher-student-row {
    min-width: 0;
    padding: 12px 0;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) minmax(90px, .45fr) minmax(120px, .6fr) auto;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--line);
}

.teacher-student-row:last-child {
    border-bottom: 0;
}

.teacher-student-row > div {
    min-width: 0;
}

.teacher-student-row strong,
.teacher-student-row span,
.teacher-student-row small {
    display: block;
}

.teacher-rate-template-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}

.teacher-rate-template-row > div {
    min-width: 0;
}

.teacher-rate-template-row strong,
.teacher-rate-template-row span {
    display: block;
}

.teacher-rate-template-row strong {
    font-size: 13px;
}

.teacher-rate-template-row span {
    color: var(--muted);
    font-size: 12px;
}

.teacher-student-row span,
.teacher-student-row small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.student-course-list {
    display: grid;
    gap: 8px;
}

.student-course-row {
    min-width: 0;
    padding: 14px;
    display: grid;
    grid-template-columns: minmax(190px, .85fr) minmax(420px, 2fr) auto;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
}

.student-course-row__primary {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.student-course-row__primary > div {
    min-width: 0;
}

.student-course-row__primary strong,
.student-course-row__primary > div > span {
    display: block;
}

.student-course-row__primary > div > span {
    margin-top: 3px;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.student-course-row__facts {
    min-width: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.student-course-row__facts div,
.student-course-row__facts dt,
.student-course-row__facts dd {
    min-width: 0;
    margin: 0;
}

.student-course-row__facts dt {
    color: var(--muted);
    font-size: 11px;
}

.student-course-row__facts dd {
    margin-top: 3px;
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
}

.student-course-row__actions {
    display: flex;
    justify-content: flex-end;
}

.student-course-row__actions .secondary-button,
.student-course-row__actions .record-status {
    min-height: 34px;
}

.student-report-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.student-report-item {
    min-width: 0;
    padding: 14px;
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
}

.student-report-item:hover {
    border-color: #9bbcaf;
}

.student-report-item > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.student-report-item > div span,
.student-report-item > small {
    color: var(--muted);
    font-size: 11px;
}

.student-report-item dl {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.student-report-item dl div {
    min-width: 0;
    padding: 8px;
    border-radius: 4px;
    background: var(--surface-soft);
}

.student-report-item dt,
.student-report-item dd {
    margin: 0;
}

.student-report-item dt {
    color: var(--muted);
    font-size: 10px;
}

.student-report-item dd {
    margin-top: 2px;
    font-size: 15px;
    font-weight: 800;
}

.student-report-item p {
    margin: 0;
    display: -webkit-box;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.empty-state.standalone {
    margin-top: 22px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.study-page {
    min-height: 100vh;
    padding-bottom: 112px;
    background: #eef3f0;
}

.study-control-lock-shell {
    min-height:100vh;
    display:grid;
    place-items:center;
    padding:24px;
}

.study-control-lock {
    width:min(620px, 100%);
    padding:32px;
    border:1px solid var(--theme-line, #d8ddd9);
    border-radius:8px;
    background:var(--theme-surface, #fff);
    box-shadow:0 18px 48px rgba(32, 45, 39, .12);
}

.study-control-lock h1 {
    margin:10px 0 12px;
    font-size:32px;
    line-height:1.25;
    letter-spacing:0;
}

.study-control-lock p {
    margin:0;
    color:var(--theme-muted, #5f6e65);
    line-height:1.75;
}

.study-control-lock__notice {
    margin-top:20px;
    padding:14px 16px;
    border-left:3px solid var(--theme-accent, #9b2c2c);
    background:var(--theme-control, #f4f7f5);
    line-height:1.65;
}

.study-control-lock__actions {
    display:flex;
    justify-content:flex-end;
    align-items:center;
    flex-wrap:wrap;
    gap:10px;
    margin-top:24px;
}

.study-control-lock__actions form {
    margin:0;
}

@media (max-width: 640px) {
    .study-control-lock-shell { padding:16px; }
    .study-control-lock { padding:24px 18px; }
    .study-control-lock h1 { font-size:26px; }
    .study-control-lock__actions,
    .study-control-lock__actions form,
    .study-control-lock__actions .primary-button,
    .study-control-lock__actions .secondary-button { width:100%; }
}

.study-header {
    position: sticky;
    z-index: 30;
    top: 0;
    min-height: 64px;
    padding: 0 max(22px, calc((100% - 1360px) / 2));
    display: grid;
    grid-template-columns: 140px 1fr auto auto auto;
    align-items: center;
    gap: 24px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .97);
}

.study-back {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--brand-dark);
    font-weight: 700;
}

.study-back img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    object-position: 22% center;
    border: 1px solid #c8d8d1;
    border-radius: 50%;
}

.study-student strong,
.study-student span,
.study-progress strong,
.study-progress span {
    display: block;
}

.study-student span,
.study-progress span {
    color: var(--muted);
    font-size: 11px;
}

.study-progress {
    min-width: 82px;
    text-align: right;
}

.end-session-button {
    min-width: 58px;
    min-height: 38px;
    border: 1px solid #d3b4ae;
    border-radius: 5px;
    color: #833a32;
    background: #fff;
    cursor: pointer;
}

.premium-study-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.premium-study-header-actions .end-session-button {
    min-width: 82px;
    min-height: 40px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.premium-study-header-actions .premium-finish-button {
    border-color: var(--brand);
    color: #fff;
    background: var(--brand);
}

.guided-study-header-actions form {
    margin: 0;
}

.guided-study-header-actions .guided-finish-button {
    border-color: #9f4d43;
    color: #fff;
    background: #9f4d43;
}

.study-shell {
    width: min(1360px, calc(100% - 44px));
    min-height: calc(100vh - 190px);
    margin: 20px auto 0;
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr) 210px;
    align-items: stretch;
    gap: 16px;
}

.study-flash {
    width: min(1360px, calc(100% - 44px));
    margin: 12px auto -8px;
}

.study-flash:empty {
    display: none;
}

.study-context,
.study-summary {
    min-width: 0;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.study-context strong {
    display: block;
    font-size: 18px;
}

.study-context p,
.study-summary p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.carryover-summary {
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid #e5bf68;
    border-radius: 6px;
    color: #73470b;
    background: #fff7e5;
}

.carryover-summary strong,
.carryover-summary span {
    display: block;
}

.carryover-summary strong {
    font-size: 13px;
}

.carryover-summary span {
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.5;
}

.study-task-stats {
    margin: 18px 0 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.study-task-stats div {
    min-width: 0;
    padding: 9px 7px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.study-task-stats dt,
.study-task-stats dd {
    margin: 0;
    display: block;
}

.study-task-stats dt {
    color: var(--muted);
    font-size: 10px;
}

.study-task-stats dd {
    margin-top: 2px;
    color: var(--ink);
    font-size: 18px;
    font-weight: 800;
}

.study-context .append-words-quick {
    display: grid;
    grid-template-columns: 1fr;
}

.study-context .append-words-quick label,
.study-context .append-words-quick .secondary-button {
    width: 100%;
}

.append-queue-control {
    min-width: 0;
}

.append-queue-manage[hidden],
.append-words-quick[hidden] {
    display: none;
}

.append-queue-status {
    margin-top: 16px;
    padding-top: 14px;
    display: grid;
    gap: 3px;
    border-top: 1px solid var(--line);
}

.append-queue-status span {
    color: var(--muted);
    font-size: 11px;
}

.study-context .append-queue-status strong {
    font-size: 14px;
}

.append-queue-manage .append-words-quick {
    margin-top: 10px;
    padding-top: 0;
    border-top: 0;
}

.append-queue-cancel {
    margin: 7px 0 0;
}

.append-queue-cancel button {
    width: 100%;
    min-height: 36px;
    border: 1px solid #d3b4ae;
    border-radius: 5px;
    color: #833a32;
    background: #fff;
    cursor: pointer;
}

.growth-meter {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.growth-meter span,
.growth-meter strong {
    display: block;
}

.growth-meter span {
    color: var(--muted);
    font-size: 11px;
}

.guided-weak-list {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.guided-weak-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.guided-weak-list > div > span {
    color: var(--muted);
    font-size: 11px;
}

.study-context .guided-weak-list > div > strong {
    font-size: 15px;
}

.guided-weak-list ol {
    max-height: 190px;
    margin: 9px 0 0;
    padding: 0;
    display: grid;
    gap: 5px;
    overflow-y: auto;
    list-style: none;
    scrollbar-gutter: stable;
}

.guided-weak-list li {
    min-width: 0;
    padding: 6px 8px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    border-left: 3px solid var(--line);
    background: var(--surface-soft);
}

.guided-weak-list li > span {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 13px;
    font-weight: 700;
}

.guided-weak-list li > small {
    font-size: 10px;
    white-space: nowrap;
}

.guided-weak-list .is-unknown { color: var(--danger); }
.guided-weak-list .is-hesitant { color: var(--gold); }
.guided-weak-list .is-skilled { color: var(--brand); }
.guided-weak-list .is-pending { color: var(--muted); }

.guided-weak-list > p {
    margin-top: 8px;
}

.guided-weak-list > p[hidden] {
    display: none;
}

.study-summary dl {
    margin: 12px 0 0;
}

.study-summary dl div {
    padding: 10px 0;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.study-summary dt {
    color: var(--muted);
}

.study-summary dd {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
}

.study-stage {
    position: relative;
    min-width: 0;
    min-height: 510px;
    padding: 24px 32px;
    display: grid;
    grid-template-rows: auto minmax(170px, 1fr) auto minmax(110px, auto) auto auto;
    border: 1px solid #c7d8d0;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 14px 34px rgba(21, 59, 48, .08);
}

.study-card-browser {
    min-width: 0;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 56px;
    align-items: stretch;
    gap: 12px;
}

.study-word-nav {
    width: 56px;
    min-height: 96px;
    align-self: center;
    border: 1px solid #b8cbc2;
    border-radius: 6px;
    color: var(--brand-dark);
    background: var(--surface-soft);
    font-family: Arial, sans-serif;
    font-size: 42px;
    line-height: 1;
    cursor: pointer;
}

.study-word-nav:hover:not(:disabled) {
    border-color: var(--brand);
    color: #fff;
    background: var(--brand);
}

.study-word-nav:disabled {
    color: #aab5b1;
    border-color: var(--line);
    background: #f4f6f5;
    cursor: default;
}

.study-card-state {
    min-height: 30px;
    padding: 0 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
}

.study-card-state strong {
    padding-left: 12px;
    border-left: 1px solid var(--line);
    font-size: 12px;
    white-space: nowrap;
}

.study-card-state strong[hidden] {
    display: none;
}

.previous-weak-badge {
    max-width: 100%;
    padding: 4px 8px;
    border: 1px solid #e5bf68;
    border-radius: 999px;
    color: #73470b;
    background: #fff7e5;
    line-height: 1.35;
    text-align: center;
}

.previous-weak-badge[hidden] {
    display: none;
}

.study-card-state .is-unknown { color: #8d332b; }
.study-card-state .is-hesitant { color: #745818; }
.study-card-state .is-skilled { color: #155c40; }
.study-card-state .is-pending { color: var(--muted); }
.study-card-state .is-success { color: var(--brand); }

.study-phase-transition {
    position: absolute;
    z-index: 20;
    inset: 0;
    padding: 32px;
    display: grid;
    align-content: center;
    justify-items: center;
    border-radius: var(--radius);
    background: var(--theme-panel-strong, var(--surface));
    text-align: center;
}

.study-phase-transition[hidden],
.rating-bar[hidden] {
    display: none;
}

.study-phase-transition > span {
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
}

.study-phase-transition h2 {
    max-width: 620px;
    margin: 12px 0 0;
    color: var(--ink);
    font-size: 30px;
    line-height: 1.3;
}

.study-phase-transition p {
    margin: 12px 0 24px;
    color: var(--muted);
    font-size: 16px;
}

.study-phase-transition .primary-button {
    min-width: 132px;
    min-height: 46px;
}

.study-phase-transition.is-target-reached {
    inset: auto 18px 18px auto;
    width: min(560px, calc(100% - 36px));
    min-height: 0;
    padding: 16px 18px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
    grid-template-areas: "eyebrow actions" "title actions" "copy actions";
    align-content: center;
    justify-items: start;
    gap: 3px 16px;
    border: 1px solid #c7d8d0;
    box-shadow: 0 10px 24px rgba(21, 59, 48, .14);
    text-align: left;
}

.study-phase-transition.is-target-reached > span {
    grid-area: eyebrow;
    font-size: 11px;
}

.study-phase-transition.is-target-reached h2 {
    grid-area: title;
    max-width: none;
    margin: 0;
    font-size: 18px;
    line-height: 1.35;
}

.study-phase-transition.is-target-reached p {
    grid-area: copy;
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.study-phase-transition.is-target-reached .study-phase-actions {
    grid-area: actions;
    align-self: center;
    width: auto;
    flex-wrap: nowrap;
}

.study-phase-transition.is-target-reached .study-phase-actions .primary-button {
    min-width: 132px;
    min-height: 44px;
}

.study-phase-actions,
.study-phase-extension {
    display: flex;
    align-items: end;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.study-phase-extension[hidden] {
    display: none;
}

.study-phase-extension label {
    min-width: 132px;
    color: var(--muted);
    font-size: 12px;
    text-align: left;
}

.study-phase-extension select {
    width: 100%;
    min-height: 46px;
    margin-top: 5px;
}

.study-phase-actions > .secondary-button,
.study-phase-extension .primary-button {
    min-height: 46px;
}

.study-direction {
    width: 230px;
    margin: 0 auto;
    padding: 3px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
}

.study-direction button {
    min-height: 36px;
    border: 0;
    border-radius: 4px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
}

.study-direction button.is-active {
    color: var(--brand-dark);
    background: #fff;
    box-shadow: 0 1px 4px rgba(24, 63, 51, .12);
    font-weight: 700;
}

.prompt-area {
    padding: 25px 0 18px;
    display: grid;
    align-content: center;
    justify-items: center;
    text-align: center;
}

.prompt-area span,
.answer-area > span {
    color: var(--muted);
    font-size: 12px;
}

.prompt-area h1 {
    max-width: 100%;
    margin: 9px 0 0;
    overflow-wrap: anywhere;
    color: #102a23;
    font-family: Georgia, "Times New Roman", "PingFang SC", serif;
    font-size: 48px;
    font-weight: 700;
}

.answer-area {
    min-height: 112px;
    max-height: min(38vh, 320px);
    padding: 15px 20px;
    align-content: start;
    justify-items: center;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scroll-margin-top: 78px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    text-align: center;
    -webkit-overflow-scrolling: touch;
}

.answer-area:not([hidden]) {
    display: grid;
}

.answer-area strong {
    max-width: 760px;
    margin-top: 5px;
    display: block;
    overflow-wrap: anywhere;
    color: var(--brand-dark);
    font-size: 21px;
    line-height: 1.55;
}

.answer-area p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.answer-examples {
    width: min(760px, 100%);
    margin-top: 12px;
    display: grid;
    gap: 8px;
    text-align: left;
}

.answer-examples[hidden] {
    display: none;
}

.answer-example {
    padding-left: 12px;
    border-left: 2px solid var(--line);
}

.answer-example__english {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
}

.answer-example span,
.answer-example small {
    display: block;
    overflow-wrap: anywhere;
}

.answer-example span {
    color: var(--ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 15px;
    line-height: 1.45;
}

.example-speak-button {
    min-width: 78px;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid #b8cbc2;
    border-radius: 5px;
    color: var(--brand-dark);
    background: var(--theme-control, #fff);
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
}

.example-speak-button:hover,
.example-speak-button:focus-visible,
.speak-button:hover,
.speak-button:focus-visible {
    border-color: var(--brand);
    outline: none;
}

.example-speak-button[hidden],
.speak-button[hidden] {
    display: none;
}

.answer-example small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.study-tools {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#finish-screening-early,
#return-to-weak-board,
#premium-return-to-board {
    min-height: 40px;
}

.weak-board {
    min-width: 0;
    padding: 4px 0;
    display: grid;
    align-content: start;
    gap: 14px;
}

.weak-board[hidden],
.study-card-browser[hidden],
.study-card-state[hidden],
.study-tools[hidden],
.weak-board__detail[hidden] {
    display: none;
}

.weak-board__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.weak-board__header span {
    color: var(--muted);
    font-size: 11px;
}

.weak-board__header h2 {
    margin: 2px 0 0;
    color: var(--ink);
    font-size: 20px;
    letter-spacing: 0;
}

.weak-board__header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}

.weak-board__footer .primary-button {
    min-width: 112px;
    min-height: 44px;
}

.weak-board__footer {
    min-width: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.weak-board__footer .study-status {
    min-width: 0;
    flex: 1 1 auto;
    text-align: left;
}

.weak-board__pages {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 7px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.weak-board__pages button {
    min-width: 58px;
    min-height: 36px;
    padding: 0 10px;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 5px;
    color: var(--muted);
    background: var(--theme-control, var(--surface-soft));
    cursor: pointer;
}

.weak-board__pages button.is-active {
    border-color: var(--brand);
    color: #fff;
    background: var(--brand);
    font-weight: 700;
}

.weak-board__words {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 9px;
}

.weak-board__word {
    min-width: 0;
    min-height: 88px;
    padding: 10px 6px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    background: var(--theme-control, var(--surface-soft));
    cursor: pointer;
}

.weak-board__word:hover,
.weak-board__word:focus-visible,
.weak-board__word.is-selected {
    border-color: var(--brand);
    outline: none;
    box-shadow: inset 0 0 0 1px var(--brand);
}

.weak-board__word strong {
    max-width: 100%;
    overflow-wrap: anywhere;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 16px;
    line-height: 1.15;
    text-align: center;
}

.weak-board__word small {
    color: var(--muted);
    font-size: 10px;
}

.weak-board__word.is-unknown small { color: var(--danger); }
.weak-board__word.is-hesitant small { color: var(--gold); }
.weak-board__word.is-skilled small { color: var(--brand); }

.weak-board__detail {
    min-height: 132px;
    padding: 14px 16px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.weak-board__detail-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.weak-board__detail-heading > strong {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--brand-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 23px;
}

.weak-board__detail-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.weak-board__detail-actions .secondary-button,
.weak-board__detail-actions .speak-button {
    min-height: 40px;
}

.weak-board__detail > p {
    margin: 4px 0 8px;
    color: var(--muted);
    font-size: 12px;
}

#weak-board-detail-meaning {
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: 15px;
    line-height: 1.5;
}

.weak-board__detail .answer-examples {
    margin-top: 10px;
}

.reveal-button,
.undo-rating-button,
.speak-button {
    min-height: 40px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #b8cbc2;
    border-radius: 5px;
    color: var(--brand-dark);
    background: #fff;
    cursor: pointer;
}

.undo-rating-button {
    color: #745818;
    border-color: #d8c080;
    background: #fffbef;
}

.undo-rating-button[hidden] {
    display: none;
}

.reveal-button {
    min-width: 120px;
    color: #fff;
    border-color: var(--brand);
    background: var(--brand);
}

.reveal-button:disabled {
    color: #53635e;
    border-color: var(--line);
    background: var(--surface-soft);
    cursor: default;
}

.study-status {
    min-height: 22px;
    margin: 0;
    color: var(--danger);
    text-align: center;
    font-size: 12px;
}

.rating-bar {
    position: fixed;
    z-index: 40;
    right: 0;
    bottom: 0;
    left: 0;
    min-height: 96px;
    padding: 13px max(22px, calc((100% - 900px) / 2));
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 -10px 28px rgba(22, 54, 45, .08);
}

.rating-button {
    min-width: 0;
    min-height: 66px;
    padding: 8px 14px;
    border: 1px solid;
    border-radius: 7px;
    background: #fff;
    cursor: pointer;
}

.rating-button strong,
.rating-button span {
    display: block;
}

.rating-button strong {
    font-size: 17px;
}

.rating-button span {
    font-size: 11px;
}

.rating-button--unknown { border-color: #d5a49e; color: #8d332b; background: #fff8f7; }
.rating-button--hesitant { border-color: #d8c080; color: #745818; background: #fffbef; }
.rating-button--skilled { border-color: #92c6ad; color: #155c40; background: #f4fcf8; }
.rating-button:disabled { border-color: #d9e0dd; color: #9aa5a1; background: #f5f7f6; cursor: not-allowed; }

.rating-button--unknown.is-selected { border-color: #9e443b; color: #7a261f; background: #fbe7e4; box-shadow: inset 0 0 0 1px #9e443b; }
.rating-button--hesitant.is-selected { border-color: #9a791f; color: #654a0e; background: #f8edc9; box-shadow: inset 0 0 0 1px #9a791f; }
.rating-button--skilled.is-selected { border-color: #287858; color: #104d36; background: #dff3e8; box-shadow: inset 0 0 0 1px #287858; }

.study-shell--free .study-stage {
    grid-template-rows: auto minmax(170px, 1fr) auto minmax(110px, auto) auto auto;
}

.study-shell--free .study-status {
    color: var(--muted);
}

.free-result-button {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid #b8cbc2;
    border-radius: 5px;
    color: var(--brand-dark);
    background: var(--surface-soft);
    cursor: pointer;
}

.free-result-button[hidden] {
    display: none;
}

.free-practice-completion {
    position: absolute;
    z-index: 20;
    inset: 0;
    padding: 32px;
    display: grid;
    align-content: center;
    justify-items: center;
    border-radius: var(--radius);
    background: var(--theme-panel-strong, var(--surface));
    text-align: center;
}

.free-practice-completion[hidden] {
    display: none;
}

.free-practice-completion > span {
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
}

.free-practice-completion h2 {
    margin: 10px 0 0;
    font-size: 26px;
}

.free-practice-completion dl {
    width: min(420px, 100%);
    margin: 20px 0 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
}

.free-practice-completion dl div {
    padding: 12px;
    border-right: 1px solid var(--line);
}

.free-practice-completion dl div:last-child {
    border-right: 0;
}

.free-practice-completion dt,
.free-practice-completion dd {
    margin: 0;
}

.free-practice-completion dt {
    color: var(--muted);
    font-size: 11px;
}

.free-practice-completion dd {
    margin-top: 3px;
    font-size: 24px;
    font-weight: 800;
}

.free-practice-completion__actions {
    width: min(600px, 100%);
    margin-top: 18px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.free-practice-completion__actions .primary-button,
.free-practice-completion__actions .secondary-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.premium-study-completion__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
}

.premium-study-completion__actions > .primary-button,
.premium-study-completion__actions > .secondary-button,
.premium-study-completion__actions > form,
.premium-study-completion__actions > form button {
    width: 100%;
    min-height: 44px;
    margin: 0;
}

.premium-study-completion__actions > form button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.premium-study-completion.is-final .premium-study-completion__actions {
    width: min(280px, 100%);
    grid-template-columns: minmax(0, 1fr);
}

.premium-study-completion > p {
    max-width: 640px;
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.premium-study-completion dl {
    width: min(600px, 100%);
}

.premium-study-completion dl div:nth-child(3n) {
    border-right: 0;
}

.premium-study-completion dl div:nth-child(n + 4) {
    border-top: 1px solid var(--line);
}

.premium-study-completion .study-status {
    min-height: 20px;
    margin: 12px 0 0;
    color: var(--danger);
}

.guided-study-completion {
    overflow-y: auto;
}

.guided-study-completion .study-status {
    min-height: 20px;
    margin: 12px 0 0;
    color: var(--danger);
}

.guided-study-completion .free-practice-completion__actions a {
    text-decoration: none;
}

.report-metric-heading {
    margin-top: 24px;
}

.premium-cancel-form,
.premium-cancel-form button {
    min-height: 42px;
}

.report-hero {
    min-height: 160px;
    padding: 28px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    border: 1px solid #c6d8d0;
    border-radius: var(--radius);
    color: #fff;
    background: #174f41;
}

.report-hero .eyebrow,
.report-hero p {
    color: #d3e9e1;
}

.report-hero p {
    margin-bottom: 0;
}

.level-emblem {
    min-width: 180px;
    padding-left: 28px;
    display: grid;
    border-left: 1px solid rgba(255, 255, 255, .3);
}

.level-emblem span,
.level-emblem small {
    color: #cfe5dd;
}

.level-emblem strong {
    font-size: 34px;
}

.report-stats {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.report-stat {
    min-height: 94px;
    padding: 18px;
    display: grid;
    align-content: center;
    border-right: 1px solid var(--line);
}

.report-stat:last-child {
    border-right: 0;
}

.report-stat span {
    color: var(--muted);
    font-size: 12px;
}

.report-stat strong {
    font-size: 29px;
}

.report-stat strong small {
    margin-left: 3px;
    font-size: 12px;
}

.report-stat--unknown strong { color: #973c33; }
.report-stat--hesitant strong { color: #8b6819; }
.report-stat--skilled strong { color: var(--brand); }

.report-layout {
    margin-top: 20px;
    display: grid;
    grid-template-columns: minmax(280px, .7fr) minmax(0, 1.3fr);
    gap: 18px;
    align-items: start;
}

.next-plan-copy {
    min-height: 90px;
    margin: 20px 0;
    color: #41564f;
}

.report-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.report-actions form {
    margin: 0;
}

.report-comment-section {
    margin-top: 18px;
}

.report-comment-form {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
    align-items: end;
    gap: 16px;
}

.report-comment-form label {
    display: grid;
    gap: 6px;
    color: #354b44;
    font-size: 13px;
    font-weight: 700;
}

.report-comment-form textarea {
    width: 100%;
    min-height: 96px;
    padding: 10px 12px;
    resize: vertical;
    border: 1px solid #bdccc6;
    border-radius: 5px;
    color: var(--ink);
    background: #fff;
    font: inherit;
}

.report-comment-form .compact-button {
    grid-column: 1 / -1;
    width: fit-content;
}

.report-comment-readonly {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.report-comment-readonly small {
    color: var(--muted);
}

.report-comment-readonly p {
    margin: 5px 0 0;
}

.narrow-page {
    max-width: 760px;
}

.schedule-plan-form {
    margin-top: 20px;
}

.payroll-summary {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.payroll-summary > div {
    min-height: 92px;
    padding: 18px 22px;
    display: grid;
    align-content: center;
    border-right: 1px solid var(--line);
}

.payroll-summary > div:last-child {
    border-right: 0;
}

.payroll-summary span,
.earning-row small,
.unbilled-row small,
.batch-row small {
    color: var(--muted);
    font-size: 12px;
}

.payroll-summary strong {
    font-size: 26px;
}

.payroll-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.payroll-list,
.batch-list {
    display: grid;
}

.earning-row,
.unbilled-row,
.batch-row {
    min-width: 0;
    padding: 15px 0;
    display: grid;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid #e2e9e6;
}

.earning-row {
    grid-template-columns: minmax(150px, 1fr) minmax(120px, .65fr) minmax(150px, .75fr) 110px 76px minmax(110px, auto);
}

.unbilled-row {
    grid-template-columns: minmax(170px, 1fr) minmax(120px, .6fr) minmax(140px, .7fr) minmax(300px, auto);
}

.batch-row {
    grid-template-columns: minmax(210px, 1fr) 80px 120px 80px minmax(170px, auto);
}

.earning-row:last-child,
.unbilled-row:last-child,
.batch-row:last-child {
    border-bottom: 0;
}

.earning-row > div,
.unbilled-row > div,
.batch-row > div {
    min-width: 0;
}

.earning-row strong,
.earning-row span,
.unbilled-row strong,
.unbilled-row span,
.batch-row strong,
.batch-row span {
    display: block;
    overflow-wrap: anywhere;
}

.earning-row > div:first-child span,
.unbilled-row > div:first-child span,
.batch-row > div:first-child span,
.batch-reference {
    color: var(--muted);
    font-size: 12px;
}

.earning-amount strong {
    color: var(--brand-dark);
    font-size: 18px;
    white-space: nowrap;
}

.payroll-status {
    width: fit-content;
    padding: 3px 7px;
    border: 1px solid #d8c99e;
    border-radius: 4px;
    color: #735b22;
    background: #fff8e7;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.payroll-status--approved {
    border-color: #b9cedd;
    color: #315d76;
    background: #eaf4f8;
}

.payroll-status--paid {
    border-color: #afd5c4;
    color: #15583f;
    background: #e6f5ed;
}

.billing-form {
    min-width: 0;
    display: grid;
    grid-template-columns: 110px 82px minmax(110px, 1fr) auto;
    gap: 6px;
}

.billing-form select,
.billing-form input,
.paid-form input {
    min-width: 0;
    min-height: 40px;
    padding: 0 9px;
    border: 1px solid #bdccc6;
    border-radius: 5px;
    color: var(--ink);
    background: #fff;
    font: inherit;
}

.paid-form {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) auto;
    gap: 7px;
}

.rate-history {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.rate-history > div {
    min-width: 0;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.rate-history strong,
.rate-history span,
.rate-history small {
    display: block;
    overflow-wrap: anywhere;
}

.rate-history span {
    color: var(--brand-dark);
    font-weight: 700;
}

.rate-history small {
    color: var(--muted);
}

/* Teacher-first payroll workspace. */
.payroll-title-row {
    align-items: flex-end;
}

.payroll-title-row > div:first-child {
    min-width: 0;
}

.payroll-title-row h1 small {
    margin-left: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.payroll-period-form {
    min-width: 310px;
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto;
    align-items: end;
    gap: 6px;
}

.payroll-period-form label {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.payroll-period-form input {
    min-width: 0;
    min-height: 40px;
    padding: 0 9px;
    border: 1px solid #bdccc6;
    border-radius: 5px;
    color: var(--ink);
    background: var(--surface);
    font: inherit;
}

.payroll-period-form .secondary-button {
    min-height: 40px;
    padding: 0 13px;
    white-space: nowrap;
}

.payroll-title-tools {
    min-width: 0;
    display: flex;
    align-items: end;
    justify-content: flex-end;
    gap: 10px;
}

.payroll-title-tools > .secondary-button {
    min-height: 40px;
    padding: 0 13px;
    white-space: nowrap;
}

.payroll-overview {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
}

.payroll-overview--teacher {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.payroll-overview > div {
    min-width: 0;
    min-height: 100px;
    padding: 17px 19px;
    display: grid;
    align-content: center;
    border-right: 1px solid var(--line);
}

.payroll-overview > div:last-child {
    border-right: 0;
}

.payroll-overview span,
.payroll-overview small {
    display: block;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 11px;
}

.payroll-overview strong {
    margin: 2px 0;
    display: block;
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: 23px;
    line-height: 1.2;
}

.payroll-view-tabs,
.payroll-status-tabs {
    margin-top: 22px;
    display: flex;
    align-items: center;
    gap: 24px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    scrollbar-width: thin;
}

.payroll-view-tabs a,
.payroll-status-tabs a {
    position: relative;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.payroll-view-tabs a::after,
.payroll-status-tabs a::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    content: "";
    background: transparent;
}

.payroll-view-tabs a.is-active,
.payroll-status-tabs a.is-active {
    color: var(--brand-dark);
}

.payroll-view-tabs a.is-active::after,
.payroll-status-tabs a.is-active::after {
    background: var(--brand);
}

.payroll-view-tabs a > span {
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    display: inline-grid;
    place-items: center;
    border-radius: 4px;
    color: #735b22;
    background: #fff2cf;
    font-size: 10px;
}

.payroll-status-tabs {
    margin-top: 0;
    gap: 20px;
}

#payroll-records {
    scroll-margin-top: 76px;
}

.payroll-status-tabs a {
    min-height: 39px;
    font-size: 12px;
}

.payroll-teacher-section {
    margin-top: 18px;
}

.payroll-teacher-table-wrap {
    border-top: 1px solid var(--line);
}

.payroll-teacher-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    table-layout: fixed;
}

.payroll-teacher-table th,
.payroll-teacher-table td {
    padding: 13px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.payroll-teacher-table th {
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 11px;
    font-weight: 800;
}

.payroll-teacher-table th:first-child { width: 170px; }
.payroll-teacher-table th:nth-child(2) { width: 145px; }
.payroll-teacher-table th:nth-child(3) { width: 104px; }
.payroll-teacher-table th:nth-child(4),
.payroll-teacher-table th:nth-child(5),
.payroll-teacher-table th:nth-child(6) { width: 112px; }
.payroll-teacher-table th:nth-child(7) { width: 82px; }
.payroll-teacher-table th:last-child { width: 104px; }

.payroll-teacher-table tbody tr:hover {
    background: var(--surface-soft);
}

.payroll-teacher-table tbody tr:last-child td {
    border-bottom: 0;
}

.payroll-teacher-table td,
.payroll-teacher-table td strong,
.payroll-teacher-table td span,
.payroll-teacher-table td small {
    overflow-wrap: anywhere;
}

.payroll-teacher-table td > strong,
.payroll-teacher-table td > small {
    display: block;
}

.payroll-teacher-table td > small,
.payroll-teacher-name span {
    margin-top: 2px;
    display: block;
    color: var(--muted);
    font-size: 10px;
}

.payroll-teacher-name strong {
    display: block;
    font-size: 14px;
}

.payroll-teacher-state,
.payroll-task-count,
.payroll-task-clear {
    width: fit-content;
    margin-bottom: 4px;
    padding: 2px 6px;
    display: block;
    border: 1px solid #afd5c4;
    border-radius: 4px;
    color: #15583f;
    background: #e6f5ed;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.payroll-teacher-state.is-left {
    border-color: #d4d9d7;
    color: #69736f;
    background: #f2f4f3;
}

.payroll-task-count {
    margin-bottom: 0;
    border-color: #dfbf79;
    color: #735b22;
    background: #fff8e7;
}

.payroll-task-clear {
    margin-bottom: 0;
}

.payroll-row-action,
.payroll-record-action {
    width: fit-content;
    min-height: 34px;
    padding: 0 10px;
    font-size: 11px;
    white-space: nowrap;
}

.payroll-detail-layout {
    margin-top: 20px;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, .72fr);
    align-items: start;
    gap: 16px;
}

.payroll-detail-layout .form-panel {
    margin: 0;
}

.payroll-detail-heading {
    min-height: 64px;
    padding: 12px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--line);
}

.payroll-detail-heading__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.payroll-detail-heading__actions .secondary-button,
.payroll-detail-actions .secondary-button,
.payroll-detail-actions .primary-button {
    width: auto;
    min-height: 40px;
    margin-top: 0;
    padding: 0 14px;
    white-space: nowrap;
}

.payroll-detail-danger {
    color: var(--danger) !important;
    border-color: var(--danger) !important;
}

.payroll-detail-main,
.payroll-detail-actions {
    min-width: 0;
    display: grid;
    gap: 16px;
    align-content: start;
}

.payroll-detail-action-panel {
    min-width: 0;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.payroll-detail-action-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.payroll-detail-action-row form {
    margin: 0;
}

.payroll-detail-pay-form {
    min-width: 0;
    flex: 1 1 230px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.payroll-detail-pay-form input,
.payroll-detail-adjust-row input {
    min-width: 0;
    min-height: 40px;
    padding: 0 10px;
    border: 1px solid #bdccc6;
    border-radius: 5px;
    color: var(--ink);
    background: #fff;
}

.payroll-detail-pay-form input {
    flex: 1 1 auto;
    width: 100%;
}

.payroll-detail-pay-form select {
    min-width: 0;
    min-height: 40px;
    padding: 0 9px;
    border: 1px solid #bdccc6;
    border-radius: 5px;
    color: var(--ink);
    background: #fff;
    font: inherit;
}

.payroll-detail-pay-form--full {
    width: 100%;
    flex: 1 0 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 10px;
}

.payroll-detail-pay-form label {
    min-width: 0;
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.payroll-detail-pay-form label,
.payroll-detail-pay-form input,
.payroll-detail-pay-form select {
    width: 100%;
}

.payroll-detail-pay-wide {
    grid-column: 1 / -1;
}

.payroll-detail-pay-button {
    width: 100% !important;
    min-height: 42px;
    color: #fff;
    background: var(--gold);
    border-color: var(--gold);
}

.payroll-detail-reverse-form {
    width: 100%;
    margin-top: 4px !important;
    padding-top: 12px;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--line);
}

.payroll-detail-reverse-form,
.payroll-detail-reject-form,
.payroll-inline-reject {
    align-items: end;
    gap: 8px;
}

.payroll-detail-reverse-form label,
.payroll-detail-reject-form label {
    min-width: 0;
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.payroll-detail-reverse-form input,
.payroll-detail-reject-form input,
.payroll-inline-reject input {
    min-width: 0;
    min-height: 40px;
    padding: 0 10px;
    border: 1px solid #bdccc6;
    border-radius: 5px;
    color: var(--ink);
    background: #fff;
}

.payroll-detail-reject-form,
.payroll-inline-actions,
.payroll-inline-reject {
    display: flex;
}

.payroll-detail-reject-form {
    width: 100%;
    flex: 1 1 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
}

.payroll-detail-reject-form small {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.payroll-inline-actions {
    min-width: 0;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.payroll-inline-reject input {
    width: 150px;
}

.course-void-panel {
    max-width: 860px;
    margin-inline: auto;
}

.course-void-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    margin: 20px 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--line);
}

.course-void-facts div {
    min-width: 0;
    padding: 14px;
    display: grid;
    gap: 4px;
    background: var(--surface);
}

.course-void-facts dt {
    color: var(--muted);
    font-size: 12px;
}

.course-void-facts dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 700;
}

.course-void-request {
    margin: 16px 0;
    padding: 14px;
    border-left: 3px solid var(--danger);
    background: #fff6f3;
}

.course-void-request p {
    margin: 6px 0 0;
    white-space: pre-wrap;
}

.course-void-form {
    display: grid;
    gap: 14px;
}

.course-void-form label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.danger-button {
    background: var(--danger) !important;
    border-color: var(--danger) !important;
}

.service-adjust-form__related[hidden] {
    display: none;
}

.service-adjust-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    margin-top: 14px;
    border-top: 1px solid var(--line);
}

.service-adjust-grid .service-adjust-form {
    min-width: 0;
    padding: 18px 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 14px;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.service-adjust-grid .service-adjust-form + .service-adjust-form {
    border-top: 1px solid var(--line);
}

.service-adjust-grid .service-adjust-form > .section-heading,
.service-adjust-grid .service-adjust-form__wide,
.service-adjust-grid .service-adjust-form__note,
.service-adjust-grid .service-adjust-form__help,
.service-adjust-grid .service-adjust-form > .form-help,
.service-adjust-grid .service-adjust-form > .primary-button {
    grid-column: 1 / -1;
}

.service-adjust-grid .service-adjust-form label {
    min-width: 0;
    margin: 0;
    display: grid;
    gap: 6px;
    color: #354b44;
    font-size: 13px;
    font-weight: 700;
}

.service-adjust-grid .service-adjust-form input,
.service-adjust-grid .service-adjust-form select {
    height: 44px;
    min-height: 44px;
}

.service-adjust-grid .service-adjust-form .input-with-unit {
    grid-template-columns: minmax(0, 1fr) 28px;
    gap: 8px;
}

.service-adjust-grid .service-adjust-form .input-with-unit em {
    min-width: 28px;
}

.service-adjust-grid .service-adjust-form > .form-help {
    min-height: 34px;
    margin: 0;
    line-height: 1.55;
}

.service-adjust-grid .service-adjust-form > .primary-button {
    width: 210px;
    min-height: 44px;
    margin: 0;
    justify-self: start;
}

.service-adjust-grid [hidden],
.premium-service-adjust-form [hidden] {
    display: none !important;
}

.service-ledger-subheading {
    margin-top: 18px;
}

.student-teacher-pricing-row {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(120px, .75fr) minmax(210px, 1.25fr);
    align-items: center;
    gap: 10px 16px;
    margin: 0;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}

.student-teacher-relationship-list {
    margin-bottom: 12px;
    border-top: 1px solid var(--line);
}

.student-teacher-pricing-row__identity,
.student-teacher-pricing-row__prices,
.student-teacher-pricing-row__actions {
    min-width: 0;
}

.student-teacher-pricing-row__identity strong,
.student-teacher-pricing-row__identity small {
    display: block;
}

.student-teacher-pricing-row__identity small {
    margin-top: 3px;
    color: var(--muted);
}

.student-teacher-pricing-row__prices {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
}

.student-teacher-pricing-row__prices div,
.student-teacher-pricing-row__prices dt,
.student-teacher-pricing-row__prices dd {
    min-width: 0;
    margin: 0;
}

.student-teacher-pricing-row__prices dt {
    color: var(--muted);
    font-size: 11px;
}

.student-teacher-pricing-row__prices dd {
    margin-top: 2px;
    font-weight: 700;
}

.student-teacher-pricing-row__actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.student-teacher-pricing-row__actions form {
    margin: 0;
}

.student-teacher-pricing-row__actions .compact-button {
    min-height: 38px;
    margin: 0;
}

.pair-pricing-form,
.pair-assignment-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 14px;
    padding: 16px 0 0;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
}

.pair-pricing-form label,
.pair-assignment-form label {
    min-width: 0;
}

.pair-pricing-form__reason,
.pair-pricing-form__heading,
.pair-pricing-form .profile-edit-actions,
.pair-assignment-form .profile-edit-actions,
.zero-price-permissions {
    grid-column: 1 / -1;
}

.pair-pricing-form__heading {
    min-width: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.pair-pricing-form__heading strong,
.pair-pricing-form__heading span {
    display: block;
}

.zero-price-permissions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 10px;
    padding: 12px;
    border: 1px solid #d5dfdb;
    border-radius: 6px;
    background: var(--surface-soft);
}

.zero-price-permissions__heading {
    grid-column: 1 / -1;
    min-width: 0;
}

.zero-price-permissions__heading strong,
.zero-price-permissions__heading span,
.zero-price-option strong,
.zero-price-option small {
    display: block;
}

.zero-price-permissions__heading strong {
    font-size: 13px;
}

.zero-price-permissions__heading span,
.zero-price-option small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
}

.zero-price-option {
    min-width: 0;
    min-height: 64px;
    margin: 0;
    padding: 10px 11px;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;
    gap: 9px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface);
    cursor: pointer;
}

.form-panel .zero-price-option input {
    width: 18px;
    height: 18px;
    min-height: 18px;
    margin: 2px 0 0;
    padding: 0;
    accent-color: var(--brand);
}

.zero-price-option strong {
    color: var(--ink);
    font-size: 13px;
}

.zero-price-option--sensitive {
    border-color: #dfca99;
    background: #fffaf0;
}

.zero-price-option.is-checked {
    border-color: #8bbba8;
    background: #eef8f3;
    box-shadow: inset 3px 0 0 var(--brand);
}

.zero-price-option--sensitive.is-checked {
    border-color: #c9a24f;
    background: #fff6df;
    box-shadow: inset 3px 0 0 var(--gold);
}

.pair-pricing-form__heading span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.compact-empty-state {
    min-height: 0;
    padding: 18px 0;
}

@media (max-width: 720px) {
    .service-adjust-grid,
    .pair-pricing-form,
    .pair-assignment-form {
        grid-template-columns: 1fr;
    }

    .zero-price-permissions {
        grid-template-columns: 1fr;
    }

    .student-teacher-pricing-row {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .student-teacher-pricing-row__actions {
        grid-column: 1;
        align-items: stretch;
        flex-direction: column;
    }

    .student-teacher-pricing-row__actions form,
    .student-teacher-pricing-row__actions .compact-button {
        width: 100%;
        justify-content: center;
    }

    .service-adjust-grid .service-adjust-form {
        grid-template-columns: 1fr;
    }

    .service-adjust-grid .service-adjust-form > .primary-button {
        width: 100%;
        justify-self: stretch;
    }
    .course-void-facts {
        grid-template-columns: 1fr;
    }

    .payroll-detail-reject-form,
    .payroll-detail-reverse-form,
    .payroll-inline-reject {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .payroll-inline-reject input,
    .payroll-detail-reject-form label,
    .payroll-detail-reverse-form label {
        width: 100%;
    }

    .payroll-detail-reject-form {
        grid-template-columns: 1fr;
    }

    .payroll-detail-reject-form .secondary-button,
    .payroll-detail-reverse-form .secondary-button {
        width: 100%;
    }
}

.payroll-detail-adjust-form {
    padding: 20px;
}

.payroll-detail-adjust-row {
    display: grid;
    grid-template-columns: minmax(0, .7fr) minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
}

.payroll-detail-adjust-row label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.payroll-detail-adjust-row .secondary-button {
    min-height: 40px;
}

.payroll-detail-main dl > span,
.payroll-detail-main dl > strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.payroll-rate-section {
    margin-top: 24px;
}

.payroll-record-heading {
    margin-bottom: 0;
}

.payroll-batch-panel {
    margin: 14px 0 4px;
    padding: 14px;
    border: 1px solid #d8c99e;
    border-radius: 6px;
    background: #fffaf0;
}

.payroll-batch-panel__summary,
.payroll-batch-panel__fields {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
}

.payroll-batch-panel__summary {
    margin-bottom: 12px;
    align-items: center;
    color: var(--muted);
    font-size: 12px;
}

.payroll-batch-panel__summary strong {
    color: var(--ink);
}

.payroll-select-page,
.payroll-earning-choice {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.payroll-select-page input,
.payroll-earning-choice input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--brand);
}

.payroll-batch-panel__fields label {
    min-width: 135px;
    display: grid;
    gap: 5px;
    flex: 1 1 155px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.payroll-batch-panel__fields input,
.payroll-batch-panel__fields select {
    min-width: 0;
    min-height: 40px;
    padding: 0 9px;
    border: 1px solid #bdccc6;
    border-radius: 5px;
    color: var(--ink);
    background: #fff;
    font: inherit;
}

.payroll-batch-panel__fields button {
    min-height: 40px;
    flex: 0 0 auto;
}

.payroll-batch-panel__fields button:disabled {
    cursor: not-allowed;
    opacity: .5;
}

.payroll-earning-choice {
    margin-bottom: 5px;
}

.payroll-batch-facts dl {
    margin: 0;
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 9px 16px;
    font-size: 13px;
}

.payroll-batch-facts dt {
    color: var(--muted);
}

.payroll-batch-facts dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.payroll-page .earning-row {
    grid-template-columns: minmax(150px, 1.1fr) minmax(105px, .55fr) minmax(135px, .68fr) 105px 74px minmax(98px, auto) auto;
}

.payroll-page .payroll-teacher-batch {
    grid-template-columns: minmax(210px, 1fr) 110px 130px 80px minmax(130px, auto);
}

@media (max-width: 1160px) {
    .payroll-title-row {
        align-items: flex-start;
    }

    .payroll-title-tools {
        display: grid;
        justify-items: end;
    }

    .payroll-overview {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .payroll-overview > div:nth-child(3) {
        border-right: 0;
    }

    .payroll-overview > div:nth-child(n + 4) {
        border-top: 1px solid var(--line);
    }

    .payroll-overview--teacher {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .payroll-overview--teacher > div:nth-child(2) {
        border-right: 0;
    }

    .payroll-overview--teacher > div:nth-child(3) {
        border-top: 1px solid var(--line);
        border-right: 1px solid var(--line);
    }

    .payroll-page .earning-row {
        grid-template-columns: minmax(145px, 1fr) minmax(105px, .6fr) 105px 74px minmax(98px, auto) auto;
    }

    .payroll-page .earning-row > div:nth-child(3) {
        display: none;
    }

    .payroll-detail-adjust-row {
        grid-template-columns: 1fr;
    }

    .payroll-detail-adjust-row .secondary-button {
        width: 100%;
    }
}

@media (max-width: 767px) {
    .payroll-title-row {
        display: block;
    }

    .payroll-title-row h1 small {
        display: block;
        margin: 4px 0 0;
    }

    .payroll-title-tools {
        width: 100%;
        margin-top: 16px;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        justify-content: stretch;
        justify-items: stretch;
    }

    .payroll-title-tools > .secondary-button {
        width: 100%;
        justify-content: center;
    }

    .payroll-period-form {
        width: 100%;
        min-width: 0;
        margin-top: 16px;
    }

    .payroll-title-tools .payroll-period-form {
        margin-top: 0;
    }

    .payroll-overview,
    .payroll-overview--teacher {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .payroll-overview > div,
    .payroll-overview--teacher > div {
        min-height: 88px;
        padding: 13px;
        border-top: 1px solid var(--line);
        border-right: 1px solid var(--line);
    }

    .payroll-overview > div:nth-child(-n + 2),
    .payroll-overview--teacher > div:nth-child(-n + 2) {
        border-top: 0;
    }

    .payroll-overview > div:nth-child(2n),
    .payroll-overview--teacher > div:nth-child(2n) {
        border-right: 0;
    }

    .payroll-overview:not(.payroll-overview--teacher) > div:last-child {
        grid-column: 1 / -1;
        border-right: 0;
    }

    .payroll-overview strong {
        font-size: 19px;
    }

    .payroll-view-tabs,
    .payroll-status-tabs {
        gap: 18px;
    }

    .payroll-teacher-section {
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .payroll-teacher-section > .section-heading {
        padding-right: 2px;
        padding-left: 2px;
    }

    .payroll-teacher-table-wrap {
        overflow: visible;
        border-top: 0;
    }

    .payroll-teacher-table,
    .payroll-teacher-table tbody,
    .payroll-teacher-table tr,
    .payroll-teacher-table td {
        width: 100%;
        min-width: 0;
        display: block;
    }

    .payroll-teacher-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .payroll-teacher-table tbody {
        display: grid;
        gap: 10px;
    }

    .payroll-teacher-table tr {
        padding: 12px;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px 12px;
        border: 1px solid var(--line);
        border-radius: 6px;
        background: var(--surface);
    }

    .payroll-teacher-table td {
        min-width: 0;
        padding: 0;
        border: 0;
    }

    .payroll-teacher-table td::before {
        margin-bottom: 2px;
        display: block;
        content: attr(data-label);
        color: var(--muted);
        font-size: 10px;
        font-weight: 700;
    }

    .payroll-teacher-table td:first-child,
    .payroll-teacher-table td:last-child {
        grid-column: 1 / -1;
    }

    .payroll-teacher-table td:first-child {
        padding-bottom: 9px;
        border-bottom: 1px solid var(--line);
    }

    .payroll-teacher-table td:last-child {
        padding-top: 3px;
    }

    .payroll-row-action {
        width: 100%;
        min-height: 40px;
        justify-content: center;
    }

    .payroll-detail-layout {
        grid-template-columns: 1fr;
    }

    .payroll-detail-heading {
        display: block;
    }

    .payroll-detail-heading__actions {
        margin-top: 12px;
        justify-content: flex-start;
    }

    .payroll-detail-heading__actions .secondary-button {
        flex: 1 1 0;
    }

    .payroll-page .earning-row,
    .payroll-page .payroll-teacher-batch {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
    }

    .payroll-page .earning-row > div:nth-child(2) {
        display: none;
    }

    .payroll-page .earning-row .earning-amount,
    .payroll-page .payroll-teacher-batch .earning-amount {
        grid-column: 2;
        grid-row: 1;
        display: block;
        text-align: right;
    }

    .payroll-page .earning-row .payroll-status,
    .payroll-page .payroll-teacher-batch .payroll-status {
        grid-column: 1;
    }

    .payroll-page .earning-row form,
    .payroll-page .earning-row .batch-reference,
    .payroll-page .earning-row .payroll-record-action,
    .payroll-page .payroll-teacher-batch > span:last-child {
        grid-column: 1 / -1;
    }

    .payroll-record-action {
        width: 100%;
        min-height: 38px;
        justify-content: center;
    }

    .payroll-detail-pay-form {
        flex-basis: 100%;
    }

    .payroll-detail-pay-form--full,
    .payroll-batch-panel__fields {
        display: grid;
        grid-template-columns: 1fr;
    }

    .payroll-detail-pay-wide {
        grid-column: 1;
    }

    .payroll-batch-panel__fields label,
    .payroll-batch-panel__fields button {
        width: 100%;
    }

    .payroll-batch-facts dl {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .payroll-batch-facts dd + dt {
        margin-top: 8px;
    }

    .payroll-detail-adjust-row {
        grid-template-columns: 1fr;
    }

    .payroll-detail-adjust-row .secondary-button {
        width: 100%;
    }
}

.review-title-row {
    align-items: flex-end;
}

.review-summary {
    margin: 18px 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    background: var(--surface);
}

.review-summary--four {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.review-summary > div,
.review-summary > a {
    min-height: 104px;
    padding: 17px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none;
}

.review-summary > :last-child {
    border-right: 0;
}

.review-summary > a:hover {
    background: var(--surface-soft);
}

.review-summary span,
.review-summary small {
    color: var(--muted);
}

.review-summary strong {
    margin: 4px 0;
    font-size: 26px;
    line-height: 1;
}

.review-summary .is-urgent {
    border-top: 3px solid #bd2c2c;
    background: #fff8f7;
}

.review-summary .is-urgent strong {
    color: #a32121;
}

.review-tabs {
    margin-bottom: 16px;
}

.review-course-list,
.review-preview-list {
    display: grid;
    gap: 12px;
}

.review-course-row {
    padding: 18px;
    border: 1px solid var(--line);
    border-left: 4px solid #d3a63d;
    border-radius: 6px;
    background: var(--surface);
}

.review-course-row.is-urgent {
    border-left-color: #bd2c2c;
}

.review-course-row > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.review-course-row > header > div {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.review-course-row > header strong,
.review-preview-list strong {
    overflow-wrap: anywhere;
}

.review-course-row > header small,
.review-preview-list small {
    color: var(--muted);
}

.review-course-type {
    width: fit-content;
    padding: 3px 7px;
    border-radius: 4px;
    background: #f1f4f7;
    color: #465466;
    font-size: 11px;
    font-weight: 700;
}

.review-course-row.is-urgent .review-course-type {
    background: #fee2e2;
    color: #a32121;
}

.review-course-row dl {
    margin: 16px 0 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.review-course-row dl > div {
    min-width: 0;
    padding: 10px 12px;
    background: var(--surface-soft);
}

.review-course-row dt {
    color: var(--muted);
    font-size: 11px;
}

.review-course-row dd {
    margin: 3px 0 0;
    overflow-wrap: anywhere;
    font-weight: 600;
}

.review-reason {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid #ead9b5;
    background: #fffaf0;
}

.review-reason p {
    margin: 5px 0 0;
    color: var(--ink-soft);
    white-space: pre-wrap;
}

.review-action-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.review-action-form {
    padding: 14px;
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.review-action-form--danger {
    border-color: #edcccc;
    background: #fff8f7;
}

.review-action-form textarea {
    resize: vertical;
}

.review-action-form button {
    width: 100%;
    justify-content: center;
}

.review-action-form small {
    color: #9a3131;
}

.review-billing-form {
    margin-top: 14px;
    display: grid;
    grid-template-columns: minmax(150px, .7fr) minmax(120px, .5fr) minmax(220px, 1.5fr) auto;
    align-items: end;
    gap: 10px;
}

.review-billing-form label {
    margin: 0;
}

.review-billing-form button {
    min-height: 44px;
}

.review-action-grid .review-billing-form {
    margin-top: 0;
    padding: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.review-action-grid .review-billing-note,
.review-action-grid .review-billing-form button {
    grid-column: 1 / -1;
}

.review-action-grid .review-billing-form button {
    width: 100%;
    justify-content: center;
}

.review-preview-list > a {
    min-height: 66px;
    padding: 11px 12px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none;
}

.review-preview-list > a:hover {
    border-color: #c8a14a;
    background: var(--surface-soft);
}

.review-preview-list > a > div {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.review-preview-list > a > span:last-child {
    color: var(--brand-dark);
    font-weight: 700;
}

.settlement-entry-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.settlement-entry-grid a {
    min-height: 92px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    text-decoration: none;
}

.settlement-entry-grid a:hover {
    border-color: #c8a14a;
    background: var(--surface-soft);
}

.settlement-entry-grid span,
.payroll-hold-note {
    color: var(--muted);
}

.course-valid-form {
    margin-top: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
    .review-summary--four,
    .review-course-row dl {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .review-billing-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .review-billing-note,
    .review-billing-form button {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .review-title-row {
        display: block;
    }

    .review-title-row > .secondary-button {
        width: 100%;
        margin-top: 12px;
        justify-content: center;
    }

    .review-summary,
    .review-summary--four,
    .review-action-grid,
    .review-course-row dl,
    .review-billing-form,
    .settlement-entry-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .review-summary > div,
    .review-summary > a {
        min-height: 82px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .review-summary > :last-child {
        border-bottom: 0;
    }

    .review-course-row {
        padding: 14px 12px;
    }

    .review-course-row > header {
        display: grid;
    }

    .review-billing-note,
    .review-billing-form button {
        grid-column: 1;
    }

    .review-preview-list > a {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .review-preview-list .review-course-type {
        grid-column: 1 / -1;
    }
}

.inline-button {
    min-height: 42px;
    margin: 0;
    display: inline-flex;
    align-items: center;
}

.weak-word-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.weak-word-list > div {
    min-width: 0;
    padding: 12px;
    border-bottom: 1px solid var(--line);
}

.weak-word-list strong,
.weak-word-list span {
    display: inline-block;
}

.weak-word-list span {
    margin-left: 7px;
    color: #8b6819;
    font-size: 11px;
}

.weak-word-list p {
    margin: 4px 0 0;
    display: -webkit-box;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

@media (max-width: 980px) {
    .admin-form-grid,
    .course-prep-layout {
        grid-template-columns: 1fr;
    }

    .active-course-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .active-course-row__facts {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .plan-item-row {
        grid-template-columns: 68px minmax(110px, .7fr) minmax(180px, 1.2fr) 105px 92px 104px;
    }

    .plan-item-row .source-chip {
        display: none;
    }

    .earning-row {
        grid-template-columns: minmax(140px, 1fr) minmax(120px, .7fr) 110px 76px auto;
    }

    .earning-row > div:nth-child(3) {
        display: none;
    }

    .unbilled-row {
        grid-template-columns: minmax(160px, 1fr) minmax(130px, .7fr) minmax(300px, auto);
    }

    .unbilled-row > div:nth-child(2) {
        display: none;
    }

    .batch-row {
        grid-template-columns: minmax(180px, 1fr) 110px 80px minmax(170px, auto);
    }

    .batch-row > div:nth-child(2) {
        display: none;
    }

    .student-row,
    .plan-row {
        grid-template-columns: 44px minmax(150px, 1.2fr) minmax(130px, 1fr) auto;
    }

    .student-row > div:nth-child(4),
    .plan-row > div:nth-child(4) {
        display: none;
    }

    .student-course-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .student-course-row__facts {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .student-report-grid {
        grid-template-columns: 1fr;
    }

    .student-profile-layout,
    .teacher-profile-layout {
        grid-template-columns: 1fr;
    }

    .study-shell {
        grid-template-columns: 180px minmax(0, 1fr);
    }

    .study-summary {
        display: none;
    }
}

@media (max-width: 767px) {
    .curriculum-plan-row__facts {
        grid-template-columns: 1fr;
    }

    .curriculum-plan-row__actions,
    .curriculum-unit-form {
        align-items: stretch;
    }

    .curriculum-unit-form {
        width: 100%;
        flex-wrap: wrap;
    }

    .curriculum-unit-form label {
        flex-basis: 100%;
    }

    .curriculum-plan-row__actions .secondary-button {
        min-height: 44px;
    }

    .app-nav {
        justify-content: flex-start;
        gap: 10px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .app-nav::-webkit-scrollbar {
        display: none;
    }

    .app-nav__link {
        flex: 0 0 auto;
    }

    .admin-form-grid,
    .course-prep-layout {
        margin-top: 14px;
    }

    .course-assignment-filter {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .course-assignment-filter form {
        width: 100%;
    }

    .active-course-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .active-course-row__facts,
    .active-course-row__actions {
        grid-column: 1;
        grid-row: auto;
    }

    .active-course-row__facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .active-course-row__actions {
        justify-content: flex-start;
    }

    .plan-add-bar {
        margin-top: 14px;
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .plan-adjust-toolbar {
        margin-top: 14px;
        align-items: stretch;
        flex-direction: column;
    }

    .plan-adjust-actions,
    .plan-adjust-actions form,
    .plan-adjust-actions button {
        width: 100%;
    }

    .plan-adjust-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .plan-item-row {
        padding: 16px 0;
        grid-template-columns: 68px minmax(0, 1fr) 92px;
        align-items: start;
    }

    .plan-item-row .plan-order-tools {
        grid-column: 1;
        grid-row: 1;
    }

    .plan-item-row .plan-word {
        grid-column: 2 / -1;
        grid-row: 1;
    }

    .plan-item-row > p {
        grid-column: 2 / -1;
        grid-row: 2;
    }

    .plan-item-row .compact-select {
        grid-column: 2;
        grid-row: 3;
    }

    .plan-item-row .include-toggle {
        grid-column: 3;
        grid-row: 3;
    }

    .plan-item-row .replace-toggle {
        grid-column: 2 / -1;
        grid-row: 4;
    }

    .word-picker__panel {
        width: 100%;
    }

    .word-picker__header {
        min-height: 70px;
        padding: 14px 16px;
    }

    .word-picker__filters {
        padding: 12px 16px;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .word-picker__filters label:first-child {
        grid-column: 1 / -1;
    }

    .word-picker__filters button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .word-picker__summary,
    .word-picker__results,
    .word-picker__pagination,
    .word-picker__footer {
        padding-right: 16px;
        padding-left: 16px;
    }

    .word-picker__footer {
        min-height: 84px;
    }

    .row-actions {
        gap: 5px;
    }

    .form-panel,
    .plan-rule-panel,
    .record-section,
    .report-section {
        padding: 16px;
    }

    .form-grid-two {
        grid-template-columns: 1fr;
    }

    .student-row,
    .plan-row {
        padding: 15px 0;
        grid-template-columns: 40px minmax(0, 1fr) auto;
    }

    .audit-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .audit-row__meta {
        padding-top: 9px;
        border-top: 1px dashed var(--line);
    }

    .plan-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .student-row > div:nth-child(3),
    .student-row > div:nth-child(4),
    .plan-row > div:nth-child(2),
    .plan-row > div:nth-child(3),
    .plan-row > div:nth-child(4) {
        display: none;
    }

    .secondary-button,
    .row-button {
        min-height: 44px;
    }

    .report-mini-grid {
        grid-template-columns: 1fr;
    }

    .student-course-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .student-course-row__facts,
    .student-course-row__actions {
        grid-column: 1;
        grid-row: auto;
    }

    .student-course-row__facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .student-course-row__actions {
        justify-content: flex-start;
    }

    .student-report-item > div {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .student-detail-header,
    .teacher-detail-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .student-detail-actions,
    .teacher-detail-actions {
        width: 100%;
    }

    .teacher-student-row {
        grid-template-columns: 40px minmax(0, 1fr) auto;
    }

    .teacher-student-row > div:nth-child(3),
    .teacher-student-row > div:nth-child(4) {
        display: none;
    }

    .study-page {
        padding-bottom: 130px;
    }

    .study-header {
        min-height: 58px;
        padding: 0 12px;
        grid-template-columns: auto 1fr auto auto auto;
        gap: 10px;
    }

    .study-back {
        font-size: 0;
    }

    .study-back img {
        width: 36px;
        height: 36px;
    }

    .study-student strong {
        max-width: 110px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .study-progress {
        min-width: 54px;
    }

    .study-progress span,
    .study-student span {
        display: none;
    }

    .end-session-button {
        min-width: 48px;
        min-height: 44px;
    }

    .premium-study-header-actions {
        gap: 5px;
    }

    .premium-study-header-actions .end-session-button {
        min-width: 68px;
        min-height: 44px;
        padding: 0 8px;
        font-size: 12px;
    }

    .study-shell {
        width: calc(100% - 20px);
        min-height: calc(100vh - 198px);
        margin-top: 10px;
        display: block;
    }

    .study-flash {
        width: calc(100% - 20px);
        margin: 10px auto 0;
    }

    .study-summary {
        display: none;
    }

    .study-context {
        margin-bottom: 10px;
        padding: 12px;
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .study-shell--free .study-context {
        display: none;
    }

    .study-context > .eyebrow,
    .study-context > strong,
    .study-context > small,
    .study-context > p {
        display: none;
    }

    .study-task-stats {
        margin: 0;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .study-task-stats div {
        padding: 7px 5px;
        text-align: center;
    }

    .study-task-stats dd {
        font-size: 16px;
    }

    .study-context .growth-meter {
        margin: 0;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-top: 0;
    }

    .study-context .carryover-summary {
        margin: 0;
        padding: 8px 10px;
    }

    .study-context .growth-meter strong {
        font-size: 15px;
    }

    .guided-weak-list {
        margin-top: 0;
        padding-top: 8px;
    }

    .guided-weak-list ol {
        max-height: 118px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .guided-weak-list li {
        padding: 6px;
    }

    .study-context .append-words-quick {
        margin: 0;
        padding-top: 10px;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
    }

    .study-context .append-words-quick .secondary-button {
        width: auto;
        min-height: 44px;
    }

    .study-context .append-words-quick select {
        height: 44px;
    }

    .append-queue-status {
        margin-top: 0;
        padding-top: 0;
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        border-top: 0;
    }

    .append-queue-manage .append-words-quick {
        padding-top: 10px;
        border-top: 1px solid var(--line);
    }

    .append-queue-cancel button {
        min-height: 44px;
    }

    .study-stage {
        min-height: calc(100vh - 200px);
        padding: 14px 16px;
        grid-template-rows: auto minmax(130px, 1fr) auto minmax(100px, auto) auto auto;
    }

    .study-card-browser {
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        gap: 6px;
    }

    .study-word-nav {
        width: 44px;
        min-height: 76px;
        font-size: 34px;
    }

    .study-card-state {
        min-height: 28px;
        padding: 0 50px;
        gap: 8px;
        flex-wrap: wrap;
    }

    .study-card-state strong {
        padding-left: 8px;
    }

    .study-phase-transition {
        padding: 24px;
    }

    .study-phase-transition h2 {
        font-size: 24px;
    }

    .study-phase-transition.is-target-reached {
        inset: auto 8px 8px;
        width: auto;
        padding: 12px;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto auto auto;
        grid-template-areas: "eyebrow" "title" "copy" "actions";
        gap: 3px;
    }

    .study-phase-transition.is-target-reached h2 {
        font-size: 20px;
    }

    .study-phase-transition.is-target-reached p {
        font-size: 12px;
    }

    .study-phase-transition.is-target-reached .study-phase-actions {
        width: 100%;
        display: grid;
        margin-top: 6px;
    }

    .study-phase-transition.is-target-reached .study-phase-actions .primary-button {
        width: 100%;
    }

    .study-phase-actions {
        width: min(280px, 100%);
        display: grid;
    }

    .study-waiting-actions {
        width: min(300px, 100%);
        display: grid;
    }

    .study-waiting-actions > form,
    .study-waiting-actions > form > button {
        width: 100%;
    }

    .study-waiting-actions .append-words-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .study-phase-extension {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .study-phase-extension label {
        min-width: 0;
    }

    .study-direction {
        width: 210px;
    }

    .study-direction button {
        min-height: 40px;
    }

    .prompt-area {
        padding: 16px 0 10px;
    }

    .prompt-area h1 {
        font-size: 34px;
        line-height: 1.28;
    }

    .answer-area {
        min-height: 100px;
        max-height: min(32vh, 220px);
        padding: 12px 10px;
        scroll-margin-top: 68px;
    }

    .answer-area strong {
        font-size: 17px;
        line-height: 1.45;
    }

    .study-tools {
        min-height: 54px;
        flex-wrap: wrap;
    }

    .reveal-button,
    .undo-rating-button,
    .speak-button,
    .example-speak-button {
        min-height: 44px;
    }

    #finish-screening-early,
    #return-to-weak-board,
    #premium-return-to-board {
        min-height: 44px;
    }

    .weak-board {
        gap: 10px;
    }

    .weak-board__header {
        align-items: end;
    }

    .weak-board__header-actions {
        align-items: stretch;
    }

    .weak-board__header-actions .undo-rating-button,
    .weak-board__footer .primary-button {
        min-height: 44px;
    }

    .weak-board__header h2 {
        font-size: 18px;
    }

    .weak-board__pages button {
        min-height: 44px;
    }

    .weak-board__words {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .weak-board__word {
        min-height: 68px;
        padding: 8px 5px;
    }

    .weak-board__detail {
        min-height: 118px;
        max-height: 34vh;
        padding: 11px 10px;
        overflow-y: auto;
    }

    .weak-board__detail-heading > strong {
        font-size: 20px;
    }

    .weak-board__detail-actions .secondary-button,
    .weak-board__detail-actions .speak-button {
        min-height: 44px;
    }

    .rating-bar {
        min-height: 116px;
        padding: 9px 10px calc(9px + env(safe-area-inset-bottom));
        gap: 7px;
    }

    .rating-button {
        min-height: 72px;
        padding: 6px 3px;
    }

    .rating-button strong {
        font-size: 15px;
    }

    .rating-button span {
        font-size: 9px;
        line-height: 1.35;
    }

    .report-hero {
        min-height: 0;
        padding: 22px;
        display: block;
    }

    .level-emblem {
        margin-top: 18px;
        padding: 14px 0 0;
        border-top: 1px solid rgba(255, 255, 255, .3);
        border-left: 0;
    }

    .report-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .report-stat,
    .report-stat:last-child {
        min-height: 78px;
        padding: 13px;
        border-right: 1px solid var(--line);
        border-bottom: 1px solid var(--line);
    }

    .report-stat:nth-child(2n) {
        border-right: 0;
    }

    .report-layout {
        grid-template-columns: 1fr;
    }

    .report-comment-form,
    .report-comment-readonly {
        grid-template-columns: 1fr;
    }

    .payroll-summary > div {
        min-height: 80px;
        padding: 14px;
    }

    .payroll-summary strong {
        font-size: 19px;
    }

    .payroll-form-grid,
    .rate-history {
        grid-template-columns: 1fr;
    }

    .earning-row,
    .unbilled-row,
    .batch-row {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
    }

    .earning-row > div:nth-child(2),
    .unbilled-row > div:nth-child(3) {
        display: none;
    }

    .earning-row .earning-amount,
    .batch-row .earning-amount {
        grid-column: 2;
        grid-row: 1;
        display: block;
        text-align: right;
    }

    .earning-row .payroll-status,
    .batch-row .payroll-status {
        grid-column: 1;
    }

    .earning-row form,
    .earning-row .batch-reference,
    .batch-row form,
    .batch-row > span:last-child,
    .unbilled-row form {
        grid-column: 1 / -1;
    }

    .billing-form {
        grid-template-columns: 1fr 90px;
    }

    .billing-form input[name="note"],
    .billing-form button {
        grid-column: 1 / -1;
    }

    .paid-form {
        grid-template-columns: 1fr;
    }

    .weak-word-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 359px) {
    .app-header__inner {
        width: calc(100% - 14px);
        gap: 6px;
    }

    .app-nav {
        gap: 4px;
    }

    .app-nav__link {
        min-width: 40px;
        font-size: 12px;
    }

    .study-student strong {
        max-width: 80px;
    }

    .study-direction {
        width: 190px;
    }
}

/* Phase 4: static reading/listening practice and three learning themes. */
.study-page,
.practice-page,
.growth-page,
.learning-theme-page {
    --theme-panel: rgba(255, 255, 255, .96);
    --theme-panel-strong: #ffffff;
    --theme-control: #f4f7f5;
    --theme-overlay-line: rgba(23, 70, 56, .15);
}

html[data-theme="academy"] .study-page,
html[data-theme="academy"] .practice-page,
html[data-theme="academy"] .growth-page,
html[data-theme="academy"] .learning-theme-page {
    --ink: #33251d;
    --muted: #756255;
    --line: #ddcdbc;
    --surface: #fffdf8;
    --surface-soft: #f7eee3;
    --page: #eadfce;
    --brand: #9a4133;
    --brand-dark: #6f2d24;
    --brand-soft: #f4ddd5;
    --gold: #a87522;
    --danger: #9b352e;
    --danger-soft: #f7dfdb;
    --theme-panel: rgba(255, 253, 248, .94);
    --theme-panel-strong: #fffdf8;
    --theme-control: #f7eee3;
    --theme-overlay-line: rgba(115, 65, 40, .19);
}

html[data-theme="aurora"] .study-page,
html[data-theme="aurora"] .practice-page,
html[data-theme="aurora"] .growth-page,
html[data-theme="aurora"] .learning-theme-page {
    --ink: #edf4f7;
    --muted: #b8c8d3;
    --line: #40596b;
    --surface: #142c3b;
    --surface-soft: #1b3748;
    --page: #081a27;
    --brand: #68d1b4;
    --brand-dark: #a8ead8;
    --brand-soft: #1c4d4d;
    --gold: #e1b45e;
    --danger: #f09b91;
    --danger-soft: #4a2a31;
    --theme-panel: rgba(15, 38, 53, .94);
    --theme-panel-strong: #142c3b;
    --theme-control: #1b3748;
    --theme-overlay-line: rgba(169, 210, 223, .22);
    color-scheme: dark;
}

.study-page,
.practice-page,
.growth-page,
.learning-theme-page {
    background-color: var(--page);
}

html[data-theme="academy"] .study-page,
html[data-theme="academy"] .practice-page,
html[data-theme="academy"] .growth-page,
html[data-theme="academy"] .learning-theme-page {
    background-image: linear-gradient(rgba(247, 238, 226, .80), rgba(232, 215, 196, .88)), url("../images/bg-academy-mountains.webp");
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
}

html[data-theme="aurora"] .study-page,
html[data-theme="aurora"] .practice-page,
html[data-theme="aurora"] .growth-page,
html[data-theme="aurora"] .learning-theme-page {
    background-image: linear-gradient(rgba(5, 20, 31, .72), rgba(7, 23, 35, .88)), url("../images/bg-moonlit-academy.webp");
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
}

.theme-switcher {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.theme-switcher__title {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.theme-switcher__group {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.theme-switcher__group-label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.theme-switcher__options {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--theme-control);
}

.theme-switcher button {
    min-width: 0;
    min-height: 38px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0;
    border-right: 1px solid var(--line);
    color: var(--muted);
    background: transparent;
    cursor: pointer;
}

.theme-switcher button:last-child {
    border-right: 0;
}

.theme-switcher button.is-active {
    color: var(--ink);
    background: var(--theme-panel-strong);
    box-shadow: inset 0 -3px 0 var(--brand);
    font-weight: 700;
}

.theme-swatch {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    border: 2px solid rgba(255, 255, 255, .72);
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(31, 52, 45, .20);
}

.theme-swatch--morning { background: #4f9c7c; }
.theme-swatch--academy { background: #a24a37; }
.theme-swatch--aurora { background: #286d91; }
.theme-swatch--dragoncourt { background: #ed6a32; }
.theme-swatch--skyrealm { background: #2458d6; }

.theme-switcher--compact {
    width: 98px;
}

.theme-switcher--compact {
    grid-template-columns: repeat(2, auto);
}

.theme-switcher--compact .theme-switcher__options {
    grid-template-columns: repeat(3, 32px);
}

.theme-switcher--compact button {
    min-height: 36px;
    padding: 0;
}

.topbar__tools {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.learning-theme-control {
    position: relative;
    flex: 0 0 auto;
}

.learning-theme-trigger {
    min-width: 76px;
    min-height: 38px;
    padding: 0 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--brand-dark);
    background: var(--theme-control);
    cursor: pointer;
}

.learning-theme-trigger:hover,
.learning-theme-trigger[aria-expanded="true"] {
    color: #fff;
    border-color: var(--brand);
    background: var(--brand);
}

.learning-theme-trigger__label {
    font-size: 13px;
    font-weight: 700;
}

.learning-theme-popover {
    position: absolute;
    z-index: 90;
    top: calc(100% + 9px);
    right: 0;
    width: min(330px, calc(100vw - 24px));
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--ink);
    background: var(--theme-panel-strong);
    box-shadow: 0 16px 36px rgba(28, 35, 31, .18);
}

.learning-theme-popover > strong,
.learning-theme-popover > span {
    display: block;
}

.learning-theme-popover > strong {
    font-size: 14px;
}

.learning-theme-popover > span {
    margin: 1px 0 10px;
    color: var(--muted);
    font-size: 11px;
}

.learning-theme-popover .theme-switcher__title {
    display: none;
}

.learning-theme-save-status {
    min-height: 18px;
    margin: 7px 0 -2px;
    color: var(--muted);
    font-size: 11px;
}

.learning-theme-save-status.is-error {
    color: var(--danger);
}

.study-preferences {
    display: grid;
    grid-template-columns: repeat(2, minmax(210px, 230px));
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.study-preferences .study-direction {
    margin: 0 auto;
}

.study-page .study-header,
.study-page .rating-bar,
.practice-page .app-header,
.growth-page .app-header {
    border-color: var(--line);
    background: var(--theme-panel);
}

.study-page .study-context,
.study-page .study-summary,
.study-page .study-stage,
.practice-page .page-title-row,
.growth-page .page-title-row,
.practice-choice,
.reading-passage,
.quiz-panel,
.listening-stage {
    border-color: var(--line);
    background: var(--theme-panel);
}

.study-page .study-stage {
    box-shadow: 0 14px 34px rgba(10, 35, 29, .12);
}

.study-page .study-direction,
.study-page .study-direction button,
.study-page .reveal-button,
.study-page .speak-button,
.study-page .example-speak-button,
.study-page .end-session-button {
    border-color: var(--line);
    color: var(--brand-dark);
    background: var(--theme-control);
}

.study-page .study-direction button.is-active,
.study-page .reveal-button {
    color: #fff;
    border-color: var(--brand);
    background: var(--brand);
}

.study-page .premium-study-header-actions .premium-finish-button {
    border-color: var(--brand);
    color: #fff;
    background: var(--brand);
}

.study-page .guided-study-header-actions .guided-finish-button {
    border-color: #9f4d43;
    color: #fff;
    background: #9f4d43;
}

.study-page .prompt-area h1 {
    color: var(--ink);
}

.practice-main {
    min-height: calc(100vh - 118px);
}

.practice-title-row .theme-switcher,
.practice-page-heading .theme-switcher {
    width: min(330px, 100%);
}

.practice-choice-grid {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.practice-choice {
    min-width: 0;
    min-height: 230px;
    padding: 24px;
    display: grid;
    grid-template-columns: 126px minmax(0, 1fr);
    grid-template-rows: 1fr auto;
    align-items: center;
    gap: 12px 22px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 14px 30px rgba(24, 53, 45, .08);
}

.practice-choice img {
    width: 126px;
    height: 126px;
    grid-row: 1 / -1;
    object-fit: contain;
}

.practice-choice h2 {
    margin: 3px 0 5px;
    font-size: 24px;
}

.practice-choice p {
    margin: 0;
    color: var(--muted);
}

.practice-kicker {
    color: var(--gold);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 11px;
    font-weight: 700;
}

.practice-start {
    width: fit-content;
    min-width: 118px;
    min-height: 44px;
    margin: 0;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.practice-theme-preview {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--theme-overlay-line);
}

.theme-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.theme-preview {
    min-height: 88px;
    padding: 16px 18px;
    display: grid;
    align-content: end;
    border: 1px solid rgba(255, 255, 255, .46);
    border-radius: 7px;
    color: #fff;
    box-shadow: 0 8px 20px rgba(15, 32, 28, .10);
}

.theme-preview strong,
.theme-preview span {
    display: block;
}

.theme-preview span {
    font-size: 11px;
    opacity: .82;
}

.theme-preview--morning { background: #3f8b6d; }
.theme-preview--academy { background: #934233; }
.theme-preview--aurora { background: #164d6c; }

.practice-page-heading {
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.practice-page-heading h1 {
    margin-bottom: 0;
}

.practice-back {
    width: fit-content;
    margin-bottom: 8px;
    display: block;
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
}

.practice-workspace {
    margin-top: 18px;
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(340px, .55fr);
    align-items: start;
    gap: 18px;
}

.reading-passage,
.listening-stage,
.quiz-panel {
    min-width: 0;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 12px 28px rgba(17, 43, 36, .08);
}

.practice-content-header {
    margin-bottom: 19px;
    padding-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--line);
}

.practice-content-header h2 {
    margin: 3px 0;
    font-family: Georgia, "Times New Roman", "PingFang SC", serif;
    font-size: 24px;
}

.practice-content-header p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.content-label {
    color: var(--brand);
    font-size: 11px;
    font-weight: 700;
}

.icon-command {
    min-width: 84px;
    min-height: 42px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 5px;
    color: var(--brand-dark);
    background: var(--theme-control);
    cursor: pointer;
}

.reading-copy {
    color: var(--ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 16px;
    line-height: 1.9;
}

.reading-copy p {
    margin: 0 0 15px;
}

.reading-copy p:last-child {
    margin-bottom: 0;
}

.vocab-word {
    margin: 0;
    padding: 0 2px;
    border: 0;
    border-bottom: 2px solid var(--gold);
    color: var(--brand-dark);
    background: transparent;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.vocab-word:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.vocab-tooltip {
    position: fixed;
    z-index: 60;
    left: 50%;
    bottom: 24px;
    width: min(220px, calc(100vw - 24px));
    padding: 10px 12px;
    transform: translateX(-50%);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    background: var(--theme-panel-strong);
    box-shadow: var(--shadow);
}

.vocab-tooltip strong,
.vocab-tooltip span {
    display: block;
}

.vocab-tooltip strong {
    color: var(--brand);
}

.vocab-tooltip span {
    color: var(--muted);
    font-size: 12px;
}

.speech-status {
    min-height: 22px;
    margin: 10px 0 0;
    color: var(--danger);
    font-size: 12px;
}

.quiz-panel {
    position: sticky;
    top: 88px;
}

.quiz-progress {
    margin-bottom: 19px;
}

.quiz-progress span {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.quiz-progress progress {
    width: 100%;
    height: 4px;
    margin-top: 7px;
    display: block;
    overflow: hidden;
    appearance: none;
    border-radius: 4px;
    background: var(--theme-control);
}

.quiz-progress progress::-webkit-progress-bar {
    border-radius: 4px;
    background: var(--theme-control);
}

.quiz-progress progress::-webkit-progress-value,
.audio-track::-webkit-progress-value {
    border-radius: 4px;
    background: var(--brand);
}

.quiz-progress progress::-moz-progress-bar,
.audio-track::-moz-progress-bar {
    border-radius: 4px;
    background: var(--brand);
}

.question-number {
    color: var(--gold);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 24px;
    font-weight: 700;
}

.question-number span {
    color: var(--muted);
    font-size: 12px;
}

.quiz-question {
    min-height: 62px;
    margin: 10px 0 15px;
    font-size: 18px;
}

.quiz-options {
    display: grid;
    gap: 8px;
}

.quiz-option {
    width: 100%;
    min-height: 48px;
    padding: 8px 11px;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    background: var(--theme-control);
    text-align: left;
    cursor: pointer;
}

.quiz-option > span {
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--muted);
    background: var(--theme-panel-strong);
    font-size: 11px;
    font-weight: 700;
}

.quiz-option strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 13px;
    font-weight: 600;
}

.quiz-option.is-selected {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px var(--brand-soft);
}

.quiz-option.is-selected > span {
    border-color: var(--brand);
    color: #fff;
    background: var(--brand);
}

.quiz-option.is-correct {
    border-color: #56a47e;
    color: #15583f;
    background: #e8f6ef;
}

.quiz-option.is-incorrect {
    border-color: #d69a92;
    color: #8b332b;
    background: #fff0ee;
}

.quiz-feedback {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 5px;
    font-size: 12px;
}

.quiz-feedback.is-correct {
    border-color: #86bea2;
    color: #15583f;
    background: #e8f6ef;
}

.quiz-feedback.is-incorrect {
    border-color: #d8a39c;
    color: #8b332b;
    background: #fff0ee;
}

.quiz-submit {
    width: 100%;
    min-height: 46px;
    margin-top: 14px;
}

.quiz-submit:disabled {
    color: var(--muted);
    background: var(--theme-control);
    cursor: not-allowed;
}

.quiz-score {
    margin-top: 14px;
    padding-top: 12px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    border-top: 1px solid var(--line);
}

.quiz-score span {
    color: var(--muted);
    font-size: 11px;
}

.quiz-score strong {
    color: var(--brand-dark);
}

.audio-control-row {
    min-height: 94px;
    padding: 17px;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--theme-control);
}

.audio-play-button {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    align-content: center;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: var(--brand);
    cursor: pointer;
}

.audio-play-button span {
    line-height: 1;
}

.audio-play-symbol {
    font-size: 17px;
}

#audio-play-label {
    margin-top: 4px;
    font-size: 9px;
}

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

.audio-track {
    width: 100%;
    height: 6px;
    display: block;
    overflow: hidden;
    appearance: none;
    border: 0;
    border-radius: 5px;
    background: var(--theme-panel-strong);
}

.audio-track::-webkit-progress-bar {
    border-radius: 5px;
    background: var(--theme-panel-strong);
}

.audio-time {
    margin-top: 7px;
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 11px;
}

.speed-control {
    display: grid;
    grid-template-columns: repeat(3, 48px);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 5px;
}

.speed-control button {
    min-height: 38px;
    padding: 0;
    border: 0;
    border-right: 1px solid var(--line);
    color: var(--muted);
    background: var(--theme-panel-strong);
    cursor: pointer;
}

.speed-control button:last-child {
    border-right: 0;
}

.speed-control button.is-active {
    color: #fff;
    background: var(--brand);
    font-weight: 700;
}

.transcript-row {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.transcript-row .speech-status {
    margin: 0;
}

.listening-transcript {
    margin: 14px 0 0;
    padding: 16px;
    border-left: 3px solid var(--gold);
    color: var(--ink);
    background: var(--theme-control);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 15px;
    line-height: 1.85;
}

.practice-page .app-footer,
.growth-page .app-footer {
    color: var(--muted);
}

html[data-theme="aurora"] .practice-page .brand img,
html[data-theme="aurora"] .growth-page .brand img,
html[data-theme="aurora"] .study-page .study-back img {
    border-color: #557184;
    background: #d8eee8;
}

html[data-theme="aurora"] .practice-page .app-nav__link,
html[data-theme="aurora"] .practice-page .icon-text-button,
html[data-theme="aurora"] .growth-page .app-nav__link,
html[data-theme="aurora"] .growth-page .icon-text-button {
    color: #c5d5dd;
}

html[data-theme="aurora"] .practice-page .icon-text-button,
html[data-theme="aurora"] .practice-page .secondary-button,
html[data-theme="aurora"] .practice-page input,
html[data-theme="aurora"] .practice-page select,
html[data-theme="aurora"] .practice-page textarea,
html[data-theme="aurora"] .growth-page .secondary-button,
html[data-theme="aurora"] .growth-page select {
    border-color: var(--line);
    color: var(--ink);
    background: var(--theme-control);
}

html[data-theme="aurora"] .quiz-option.is-correct,
html[data-theme="aurora"] .quiz-feedback.is-correct {
    color: #bdebd6;
    background: #17483c;
}

html[data-theme="aurora"] .quiz-option.is-incorrect,
html[data-theme="aurora"] .quiz-feedback.is-incorrect {
    color: #ffd0ca;
    background: #4a2a31;
}

html[data-theme="aurora"] .study-page .rating-button--unknown {
    border-color: #a86e69;
    color: #ffd0ca;
    background: #44272d;
}

html[data-theme="aurora"] .study-page .rating-button--hesitant {
    border-color: #a58a53;
    color: #f4d996;
    background: #3c3526;
}

html[data-theme="aurora"] .study-page .rating-button--skilled {
    border-color: #4f9c82;
    color: #c2f0dd;
    background: #173f39;
}

html[data-theme="aurora"] .study-page .rating-button:disabled {
    border-color: #405363;
    color: #8395a1;
    background: #172b38;
}

@media (max-width: 980px) {
    .practice-choice {
        grid-template-columns: 96px minmax(0, 1fr);
    }

    .practice-choice img {
        width: 96px;
        height: 96px;
    }

    .practice-workspace {
        grid-template-columns: 1fr;
    }

    .quiz-panel {
        position: static;
    }
}

@media (max-width: 767px) {
    html[data-theme="academy"] .study-page,
    html[data-theme="academy"] .practice-page,
    html[data-theme="academy"] .growth-page,
    html[data-theme="academy"] .learning-theme-page,
    html[data-theme="aurora"] .study-page,
    html[data-theme="aurora"] .practice-page,
    html[data-theme="aurora"] .growth-page,
    html[data-theme="aurora"] .learning-theme-page {
        background-attachment: scroll;
    }

    .study-preferences {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 7px;
    }

    .study-preferences .study-direction,
    .study-preferences .theme-switcher {
        margin: 0;
    }

    .theme-switcher__options button {
        min-height: 44px;
    }

    .theme-switcher--compact .theme-switcher__options button {
        min-height: 36px;
    }

    .learning-theme-trigger {
        width: 44px;
        min-width: 44px;
        min-height: 44px;
        padding: 0;
    }

    .learning-theme-trigger__label {
        display: none;
    }

    .learning-theme-popover {
        position: fixed;
        top: 66px;
        right: 8px;
        left: 8px;
        width: auto;
        max-height: calc(100vh - 82px);
        max-height: calc(100dvh - 82px);
        overflow-y: auto;
    }

    .guided-study-session-page .learning-theme-popover {
        top: 116px;
        max-height: calc(100vh - 132px);
        max-height: calc(100dvh - 132px);
    }

    .practice-title-row .theme-switcher {
        margin-top: 18px;
    }

    .practice-choice-grid,
    .theme-preview-grid {
        grid-template-columns: 1fr;
    }

    .practice-choice {
        min-height: 0;
        padding: 18px;
        grid-template-columns: 82px minmax(0, 1fr);
        gap: 10px 14px;
    }

    .practice-choice img {
        width: 82px;
        height: 82px;
        grid-row: 1;
    }

    .practice-choice h2 {
        font-size: 20px;
    }

    .practice-start {
        width: 100%;
        grid-column: 1 / -1;
    }

    .theme-preview {
        min-height: 74px;
    }

    .practice-page-heading {
        display: block;
    }

    .practice-page-heading .theme-switcher {
        margin-top: 15px;
    }

    .practice-workspace {
        margin-top: 14px;
    }

    .reading-passage,
    .listening-stage,
    .quiz-panel {
        padding: 17px;
    }

    .practice-content-header h2 {
        font-size: 20px;
    }

    .reading-copy {
        font-size: 15px;
        line-height: 1.82;
    }

    .quiz-question {
        min-height: 0;
    }

    .quiz-option,
    .quiz-submit {
        min-height: 48px;
    }

    .audio-control-row {
        padding: 14px;
        grid-template-columns: 54px minmax(0, 1fr);
        gap: 13px;
    }

    .audio-play-button {
        width: 54px;
        height: 54px;
    }

    .speed-control {
        grid-column: 1 / -1;
        grid-template-columns: repeat(3, 1fr);
    }

    .speed-control button {
        min-height: 44px;
    }

    .transcript-row {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 359px) {
    .practice-choice {
        grid-template-columns: 70px minmax(0, 1fr);
        padding: 15px;
    }

    .practice-choice img {
        width: 70px;
        height: 70px;
    }

    .theme-switcher__name {
        display: none;
    }
}

/* Phase 5: L0-L35 growth profile, six dragon stages, and collectible rewards. */
.student-row__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
}

.student-row__actions .secondary-button {
    white-space: nowrap;
}

.growth-main {
    min-height: calc(100vh - 118px);
}

.growth-title-row {
    align-items: flex-start;
}

.growth-title-row > div:first-child {
    max-width: 620px;
}

.growth-title-tools {
    width: min(330px, 100%);
    display: grid;
    grid-template-columns: minmax(190px, 1fr);
    align-items: end;
    gap: 14px;
}

.growth-student-picker {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
}

.growth-student-picker label {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.growth-student-picker select {
    min-width: 0;
    height: 40px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 5px;
    color: var(--ink);
    background: var(--theme-control);
}

.growth-student-picker .secondary-button {
    min-height: 40px;
    padding: 0 12px;
}

.growth-hero {
    min-height: 420px;
    margin-top: 18px;
    padding: 38px 46px;
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(300px, .88fr);
    align-items: center;
    gap: 36px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--theme-panel);
    box-shadow: 0 14px 34px rgba(10, 35, 29, .09);
}

.growth-stage-label {
    display: block;
    margin-bottom: 7px;
    color: var(--gold);
    font-size: 12px;
    font-weight: 800;
}

.growth-hero__copy h2 {
    margin-bottom: 8px;
    font-size: 27px;
}

.growth-hero__copy > p {
    color: var(--muted);
}

.growth-level-line {
    margin-top: 26px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
}

.growth-level-line strong {
    color: var(--brand-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 48px;
    line-height: 1;
}

.growth-level-line span {
    color: var(--muted);
    font-weight: 700;
}

.growth-level-progress {
    width: 100%;
    height: 11px;
    margin-top: 12px;
    display: block;
    overflow: hidden;
    appearance: none;
    border: 0;
    border-radius: 8px;
    background: var(--theme-control);
}

.growth-level-progress::-webkit-progress-bar {
    border-radius: 8px;
    background: var(--theme-control);
}

.growth-level-progress::-webkit-progress-value {
    border-radius: 8px;
    background: var(--brand);
}

.growth-level-progress::-moz-progress-bar {
    border-radius: 8px;
    background: var(--brand);
}

.growth-next-copy {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
}

.growth-next-copy strong {
    color: var(--ink);
}

.growth-facts {
    margin: 27px 0 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.growth-facts div {
    min-width: 0;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.growth-facts dt,
.growth-facts dd {
    margin: 0;
}

.growth-facts dt {
    color: var(--muted);
    font-size: 11px;
}

.growth-facts dd {
    overflow-wrap: anywhere;
    font-weight: 700;
}

.growth-hero__figure {
    min-width: 0;
    margin: 0;
    display: grid;
    justify-items: center;
}

.growth-hero__figure img {
    width: min(360px, 100%);
    aspect-ratio: 1;
    object-fit: contain;
    filter: drop-shadow(0 16px 17px rgba(90, 57, 25, .20));
}

.growth-hero__figure figcaption {
    margin-top: -8px;
    color: var(--muted);
    font-size: 11px;
}

.growth-stage-section,
.growth-reward-section {
    margin-top: 30px;
}

.growth-stage-track {
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    list-style: none;
}

.growth-stage-step {
    min-width: 0;
    min-height: 198px;
    padding: 12px 10px 14px;
    display: grid;
    grid-template-rows: 112px auto auto auto;
    justify-items: center;
    align-content: start;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--theme-panel);
    text-align: center;
}

.growth-stage-step__image {
    width: 108px;
    height: 108px;
}

.growth-stage-step__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.growth-stage-step > span,
.growth-stage-step > small {
    color: var(--muted);
    font-size: 10px;
}

.growth-stage-step > strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 13px;
}

.growth-stage-step.is-current {
    border-color: var(--brand);
    box-shadow: inset 0 -3px 0 var(--brand);
}

.growth-stage-step.is-current > small,
.growth-stage-step.is-complete > small {
    color: var(--brand);
    font-weight: 800;
}

.growth-stage-step.is-locked .growth-stage-step__image {
    filter: grayscale(1);
    opacity: .36;
}

.growth-reward-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.growth-reward-card {
    min-width: 0;
    min-height: 300px;
    padding: 18px;
    display: grid;
    grid-template-rows: 150px minmax(0, 1fr);
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--theme-panel);
}

.growth-reward-card__image {
    position: relative;
    min-width: 0;
    display: grid;
    place-items: center;
}

.growth-reward-card__image img {
    width: 138px;
    height: 138px;
    object-fit: contain;
}

.growth-reward-card__image > span {
    position: absolute;
    right: 0;
    top: 0;
    padding: 3px 7px;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--muted);
    background: var(--theme-control);
    font-size: 10px;
    font-weight: 800;
}

.growth-reward-card.is-earned {
    border-color: #d4bc81;
}

.growth-reward-card.is-earned .growth-reward-card__image > span {
    border-color: #d4bc81;
    color: #765719;
    background: #fff7df;
}

.growth-reward-card.is-locked .growth-reward-card__image img {
    filter: grayscale(1);
    opacity: .28;
}

.growth-reward-card__copy small,
.growth-reward-card__copy time,
.growth-reward-card__copy > span {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.growth-reward-card__copy small {
    color: var(--gold);
    font-weight: 800;
}

.growth-reward-card__copy h3 {
    margin: 2px 0 4px;
    overflow-wrap: anywhere;
    font-size: 17px;
    line-height: 1.35;
}

.growth-reward-card__copy p {
    margin-bottom: 9px;
    color: var(--muted);
    font-size: 12px;
}

.growth-empty {
    margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--theme-panel);
}

html[data-theme="aurora"] .growth-reward-card.is-earned .growth-reward-card__image > span {
    color: #f3d890;
    background: #443920;
}

@media (max-width: 1080px) {
    .growth-title-row {
        display: block;
    }

    .growth-title-tools {
        margin-top: 20px;
    }

    .growth-title-tools > .theme-switcher:only-child {
        grid-column: 1 / -1;
    }

    .growth-stage-track {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .growth-reward-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .student-row__actions {
        display: grid;
        gap: 5px;
    }

    .student-row__actions .secondary-button {
        min-height: 36px;
        padding: 0 9px;
        font-size: 11px;
    }

    .growth-title-tools {
        grid-template-columns: 1fr;
    }

    .growth-title-tools > .theme-switcher:only-child {
        grid-column: 1;
    }

    .growth-hero {
        min-height: 0;
        padding: 23px 20px;
        display: flex;
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 8px;
    }

    .growth-hero__figure img {
        width: min(230px, 72vw);
    }

    .growth-hero__figure figcaption {
        margin-top: -2px;
    }

    .growth-hero__copy h2 {
        font-size: 23px;
    }

    .growth-level-line {
        margin-top: 20px;
    }

    .growth-level-line strong {
        font-size: 39px;
    }

    .growth-facts {
        margin-top: 22px;
        gap: 8px;
    }

    .growth-stage-section,
    .growth-reward-section {
        margin-top: 24px;
    }

    .growth-stage-track {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .growth-stage-step {
        min-height: 180px;
        grid-template-rows: 98px auto auto auto;
    }

    .growth-stage-step__image {
        width: 94px;
        height: 94px;
    }

    .growth-reward-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .growth-reward-card {
        min-height: 270px;
        padding: 12px;
        grid-template-rows: 125px minmax(0, 1fr);
    }

    .growth-reward-card__image img {
        width: 116px;
        height: 116px;
    }

    .growth-reward-card__copy h3 {
        font-size: 15px;
    }
}

@media (max-width: 359px) {
    .growth-facts {
        grid-template-columns: 1fr;
    }

    .growth-reward-grid {
        grid-template-columns: 1fr;
    }

    .growth-reward-card {
        min-height: 245px;
    }
}

@media (max-width: 767px) {
    .free-practice-setup {
        margin-top: 10px;
    }

    .free-practice-form {
        width: 100%;
    }

    .free-practice-form .form-grid-two {
        grid-template-columns: 1fr;
    }

    .study-shell--free .study-context {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
        gap: 4px 10px;
    }

    .study-shell--free .study-context > strong,
    .study-shell--free .study-context > small {
        min-width: 0;
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .study-shell--free .study-context > strong {
        font-size: 13px;
    }

    .study-shell--free .study-context > small {
        color: var(--muted);
        font-size: 10px;
        text-align: right;
    }

    .study-shell--free .study-task-stats {
        grid-column: 1 / -1;
    }

    .study-shell--free .guided-weak-list {
        grid-column: 1 / -1;
    }

    .study-shell--free .study-stage {
        min-height: calc(100vh - 286px);
        grid-template-rows: auto minmax(130px, 1fr) auto minmax(96px, auto) auto auto;
    }

    .study-shell--free .study-tools {
        flex-wrap: wrap;
    }

    .free-practice-completion {
        padding: 18px;
    }

    .premium-study-completion {
        align-content: start;
        overflow-y: auto;
    }

    .free-practice-completion h2 {
        font-size: 21px;
    }

    .free-practice-completion__actions {
        width: min(280px, 100%);
        display: grid;
        grid-template-columns: 1fr;
    }

    .free-practice-completion__actions .primary-button,
    .free-practice-completion__actions .secondary-button {
        width: 100%;
        min-height: 44px;
    }

    .premium-study-completion dl {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .premium-study-completion dl div {
        padding: 9px 6px;
    }

    .premium-study-completion dd {
        font-size: 20px;
    }

    .premium-cancel-form,
    .premium-cancel-form button {
        width: 100%;
        min-height: 44px;
    }
}

@media (max-width: 520px) {
    .guided-study-session-page .study-header {
        grid-template-columns: auto minmax(52px, 1fr) auto auto;
        gap: 6px;
    }

    .guided-study-session-page .study-student {
        display: none;
    }

    .guided-study-session-page .study-progress {
        justify-self: end;
    }

    .premium-study-session-page .study-header {
        grid-template-columns: auto minmax(52px, 1fr) auto auto;
        gap: 6px;
    }

    .premium-study-session-page .study-student {
        display: none;
    }

    .premium-study-session-page .study-progress {
        justify-self: end;
    }

    .premium-study-header-actions .end-session-button {
        min-width: 62px;
        padding: 0 6px;
    }
}

@media (max-width: 720px) {
    .guided-curriculum-overview {
        padding: 18px 0;
    }

    .guided-curriculum-row {
        padding: 13px;
    }

    .guided-curriculum-row__heading,
    .guided-curriculum-row__heading > div {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .student-current-curriculum {
        padding: 18px 0;
    }

    .student-current-curriculum__heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .student-current-curriculum dl,
    .word-summary-strip,
    .student-word-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .word-summary-strip a {
        padding: 14px;
        border-bottom: 1px solid var(--line);
    }

    .word-summary-strip a:nth-child(2n),
    .student-word-overview > div:nth-child(2n) {
        border-right: 0;
    }

    .word-summary-strip a:last-child,
    .student-word-overview > div:last-child {
        grid-column: 1 / -1;
    }

    .word-summary-strip a:last-child {
        border-bottom: 0;
    }

    .student-word-overview > div:last-child {
        border-top: 1px solid var(--line);
    }

    .paused-curriculum-row {
        grid-template-columns: 1fr auto;
    }

    .paused-curriculum-row > span {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

/* Teacher-guided classroom: prioritize learning content over controls. */
.guided-study-session-page {
    padding-bottom: 90px;
}

.guided-study-session-page .study-header {
    grid-template-columns: 140px minmax(0, 1fr) auto auto auto;
}

.guided-study-session-page .study-shell {
    grid-template-columns: 210px minmax(0, 1fr) 180px;
    gap: 14px;
}

.guided-study-session-page .study-context,
.guided-study-session-page .study-summary {
    padding: 17px;
}

.guided-study-session-page .study-stage {
    --guided-answer-height: clamp(240px, 34vh, 300px);
    align-self: start;
    min-height: 540px;
    padding: 18px 24px;
}

.guided-study-session-page .study-stage.has-active-card {
    min-height: 620px;
    height: calc(100vh - 158px);
    grid-template-rows: auto minmax(190px, 1fr) auto auto var(--guided-answer-height) auto;
}

.guided-study-session-page .study-stage.has-active-card.is-weak-board-view {
    height: auto;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.guided-study-session-page .study-preferences {
    grid-template-columns: repeat(2, 176px);
    gap: 8px;
}

.guided-study-session-page .study-preferences .study-direction {
    width: 176px;
    padding: 2px;
}

.guided-study-session-page .study-preferences .study-direction button {
    min-height: 30px;
    font-size: 12px;
}

.guided-study-session-page .prompt-area {
    padding: 18px 0 10px;
}

.guided-study-session-page #prompt-text {
    max-width: 920px;
    font-size: 40px;
    line-height: 1.32;
    letter-spacing: 0;
}

.guided-study-session-page #prompt-text[lang="en"] {
    font-size: 68px;
    line-height: 1.12;
}

.guided-study-session-page .answer-area {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    padding: 18px 24px;
}

.guided-study-session-page .answer-slot {
    min-width: 0;
    min-height: var(--guided-answer-height);
    height: var(--guided-answer-height);
}

.guided-study-session-page .answer-slot[hidden] {
    display: none;
}

.guided-study-session-page #answer-primary {
    max-width: 860px;
    font-size: 25px;
    line-height: 1.52;
    letter-spacing: 0;
}

.guided-study-session-page #answer-primary[lang="en"] {
    font-size: 44px;
    line-height: 1.2;
}

.guided-study-session-page .answer-area p {
    font-size: 14px;
}

.guided-study-session-page .answer-examples {
    width: min(860px, 100%);
    margin-top: 15px;
    gap: 11px;
}

.guided-study-session-page .answer-example {
    padding-left: 14px;
}

.guided-study-session-page .answer-example span {
    font-size: 17px;
    line-height: 1.5;
}

.guided-study-session-page .answer-example small {
    margin-top: 4px;
    font-size: 15px;
    line-height: 1.48;
}

.guided-study-session-page .study-tools {
    min-height: 44px;
    gap: 7px;
}

.guided-study-session-page .reveal-button,
.guided-study-session-page .undo-rating-button,
.guided-study-session-page .speak-button,
.guided-study-session-page #finish-screening-early,
.guided-study-session-page #return-to-weak-board {
    min-width: 0;
    min-height: 34px;
    padding: 0 11px;
    font-size: 12px;
}

.guided-study-session-page .example-speak-button {
    min-width: 70px;
    min-height: 32px;
    padding: 0 9px;
    font-size: 11px;
}

.guided-study-session-page .rating-bar {
    min-height: 72px;
    padding: 8px max(22px, calc((100% - 760px) / 2));
    gap: 10px;
}

.guided-study-session-page .rating-button {
    min-height: 52px;
    padding: 6px 12px;
}

.guided-study-session-page .rating-button strong {
    font-size: 17px;
}

.guided-study-session-page .rating-button span {
    display: none;
}

.guided-study-session-page .guided-weak-list {
    position: relative;
}

.guided-study-session-page .guided-weak-list ol {
    min-height: 190px;
    height: 190px;
}

.guided-study-session-page .guided-weak-list > p {
    position: absolute;
    top: 48px;
    right: 8px;
    left: 8px;
    margin: 0;
    text-align: center;
}

.guided-study-session-page .weak-board {
    gap: 12px;
}

.guided-study-session-page .weak-board__workspace {
    min-width: 0;
    min-height: 350px;
    display: grid;
    grid-template-columns: minmax(210px, 270px) minmax(0, 1fr);
    gap: 20px;
}

.guided-study-session-page .weak-board__list-panel {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 10px;
}

.guided-study-session-page .weak-board__pages {
    min-height: 34px;
}

.guided-study-session-page .weak-board__pages button {
    min-height: 32px;
}

.guided-study-session-page .weak-board__words {
    grid-template-columns: 1fr;
    gap: 8px;
}

.guided-study-session-page .weak-board__word {
    min-height: 56px;
    padding: 9px 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    align-content: center;
    justify-items: stretch;
    gap: 10px;
    text-align: left;
}

.guided-study-session-page .weak-board__word strong {
    font-size: 20px;
    line-height: 1.2;
    text-align: left;
}

.guided-study-session-page .weak-board__word small {
    font-size: 11px;
    white-space: nowrap;
}

.guided-study-session-page .weak-board__answer-panel {
    min-width: 0;
    min-height: 350px;
    padding-left: 20px;
    border-left: 1px solid var(--line);
}

.guided-study-session-page .weak-board__placeholder {
    min-height: 350px;
    display: grid;
    align-content: center;
    justify-items: center;
    color: var(--muted);
    text-align: center;
}

.guided-study-session-page .weak-board__placeholder[hidden] {
    display: none;
}

.guided-study-session-page .weak-board__placeholder span,
.guided-study-session-page .weak-board__placeholder strong {
    display: block;
}

.guided-study-session-page .weak-board__placeholder span {
    font-size: 11px;
}

.guided-study-session-page .weak-board__placeholder strong {
    margin-top: 5px;
    color: var(--ink);
    font-size: 17px;
}

.guided-study-session-page .weak-board__detail {
    min-height: 0;
    padding: 4px 0 0;
    border-top: 0;
    border-bottom: 0;
}

.guided-study-session-page .weak-board__detail-heading {
    align-items: flex-start;
}

.guided-study-session-page .weak-board__detail-heading > strong {
    font-size: 34px;
    line-height: 1.2;
}

.guided-study-session-page .weak-board__detail > p {
    margin: 7px 0 12px;
    font-size: 14px;
}

.guided-study-session-page #weak-board-detail-meaning {
    font-size: 20px;
    line-height: 1.55;
}

.guided-study-session-page .weak-board__detail .answer-examples {
    margin-top: 18px;
}

.guided-study-session-page .weak-board__detail-actions .secondary-button,
.guided-study-session-page .weak-board__detail-actions .speak-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
}

@media (max-width: 1180px) {
    .guided-study-session-page .weak-board__workspace {
        min-height: 0;
        display: block;
    }

    .guided-study-session-page .weak-board__words {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .guided-study-session-page .weak-board__word:nth-child(5):last-child {
        grid-column: 1 / -1;
    }

    .guided-study-session-page .weak-board__answer-panel {
        min-height: 260px;
        margin-top: 14px;
        padding: 16px 0 0;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .guided-study-session-page .weak-board__detail {
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 980px) {
    .guided-study-session-page .study-shell {
        grid-template-columns: 180px minmax(0, 1fr);
    }

    .guided-study-session-page #prompt-text[lang="en"] {
        font-size: 56px;
    }

    .guided-study-session-page #prompt-text[lang="en"].is-long-word {
        font-size: 44px;
    }

    .guided-study-session-page #prompt-text[lang="en"].is-very-long-word {
        font-size: 38px;
    }
}

@media (max-width: 767px) {
    .guided-study-session-page .study-header {
        grid-template-columns: auto minmax(52px, 1fr) auto;
        grid-template-areas:
            "back student progress"
            "theme actions actions";
    }

    .guided-study-session-page .study-back { grid-area: back; }
    .guided-study-session-page .study-student { grid-area: student; }
    .guided-study-session-page .study-progress { grid-area: progress; }
    .guided-study-session-page .learning-theme-control { grid-area: theme; }
    .guided-study-session-page .guided-study-header-actions {
        grid-area: actions;
        justify-self: end;
    }

    .guided-study-session-page {
        padding-bottom: 94px;
    }

    .guided-study-session-page .study-shell {
        width: calc(100% - 16px);
        min-height: calc(100vh - 166px);
        margin-top: 8px;
        display: block;
    }

    .guided-study-session-page .study-context {
        margin-bottom: 8px;
        padding: 10px;
        gap: 8px;
    }

    .guided-study-session-page .guided-weak-list ol {
        display: flex;
        gap: 6px;
        width: 100%;
        min-width: 0;
        min-height: 36px;
        height: 36px;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 2px;
    }

    .guided-study-session-page .guided-weak-list {
        width: 100%;
        min-width: 0;
    }

    .guided-study-session-page .guided-weak-list li {
        flex: 0 0 auto;
        min-width: 132px;
    }

    .guided-study-session-page .guided-weak-list > p {
        top: 43px;
    }

    .guided-study-session-page .study-stage {
        --guided-answer-height: clamp(260px, 40vh, 340px);
        min-height: calc(100vh - 176px);
        padding: 12px;
    }

    .guided-study-session-page .study-stage.has-active-card {
        min-height: 640px;
        height: auto;
        grid-template-rows: auto minmax(150px, 1fr) auto auto var(--guided-answer-height) auto;
    }

    .guided-study-session-page.is-weak-board-mode {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .guided-study-session-page .study-stage.has-active-card.is-weak-board-view {
        min-height: 0;
        grid-template-rows: auto auto auto;
    }

    .guided-study-session-page .study-preferences {
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .guided-study-session-page .study-preferences .study-direction {
        width: 100%;
    }

    .guided-study-session-page .study-preferences .study-direction button {
        min-height: 44px;
        padding: 0 4px;
        font-size: 12px;
    }

    .guided-study-session-page .prompt-area {
        padding: 15px 0 8px;
    }

    .guided-study-session-page #prompt-text {
        font-size: 30px;
        line-height: 1.35;
    }

    .guided-study-session-page #prompt-text[lang="en"] {
        font-size: 40px;
        line-height: 1.15;
    }

    .guided-study-session-page #prompt-text[lang="en"].is-long-word {
        font-size: 36px;
    }

    .guided-study-session-page #prompt-text[lang="en"].is-very-long-word {
        font-size: 32px;
    }

    .guided-study-session-page .answer-area {
        min-height: 0;
        max-height: none;
        padding: 14px 10px calc(92px + env(safe-area-inset-bottom));
    }

    .guided-study-session-page #answer-primary {
        font-size: 21px;
        line-height: 1.5;
    }

    .guided-study-session-page #answer-primary[lang="en"] {
        font-size: 34px;
        line-height: 1.2;
    }

    .guided-study-session-page .answer-example span {
        font-size: 15px;
    }

    .guided-study-session-page .answer-example small {
        font-size: 14px;
    }

    .guided-study-session-page .study-tools {
        height: 52px;
        min-height: 52px;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        align-items: center;
        gap: 2px;
    }

    .guided-study-session-page .study-tools .reveal-button,
    .guided-study-session-page .study-tools .undo-rating-button,
    .guided-study-session-page .study-tools .speak-button,
    .guided-study-session-page .study-tools #finish-screening-early,
    .guided-study-session-page .study-tools #return-to-weak-board {
        position: relative;
        isolation: isolate;
        width: 100%;
        min-width: 0;
        min-height: 44px;
        height: 44px;
        padding: 0 4px;
        border: 0;
        color: var(--brand-dark);
        background: transparent;
        font-size: 11px;
        white-space: nowrap;
    }

    .guided-study-session-page .study-tools .reveal-button::before,
    .guided-study-session-page .study-tools .undo-rating-button::before,
    .guided-study-session-page .study-tools .speak-button::before,
    .guided-study-session-page .study-tools #finish-screening-early::before,
    .guided-study-session-page .study-tools #return-to-weak-board::before {
        position: absolute;
        z-index: -1;
        content: "";
        inset: 6px 3px;
        border: 1px solid var(--line);
        border-radius: 5px;
        background: var(--surface-soft);
    }

    .guided-study-session-page .study-tools .reveal-button::before,
    .guided-study-session-page .study-tools #finish-screening-early:not(:disabled)::before {
        border-color: var(--brand);
        background: var(--surface-soft);
    }

    .guided-study-session-page .study-tools button:focus-visible {
        outline: 2px solid var(--gold);
        outline-offset: -6px;
    }

    .guided-study-session-page .study-tools button:disabled {
        color: var(--muted);
        opacity: .68;
    }

    .guided-study-session-page .example-speak-button {
        min-height: 44px;
    }

    .guided-study-session-page .rating-bar {
        min-height: 82px;
        padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
        gap: 7px;
    }

    .guided-study-session-page .rating-button {
        min-height: 54px;
        padding: 5px 3px;
    }

    .guided-study-session-page .rating-button strong {
        font-size: 16px;
    }

    .guided-study-session-page .weak-board__workspace {
        min-height: 292px;
        height: 292px;
        display: block;
    }

    .guided-study-session-page .weak-board__footer {
        height: 44px;
        min-height: 44px;
        gap: 6px;
    }

    .guided-study-session-page .weak-board__footer .study-status {
        min-height: 18px;
        overflow: hidden;
        color: var(--muted);
        font-size: 11px;
        line-height: 18px;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .guided-study-session-page .weak-board__footer #detect-weak-page,
    .guided-study-session-page .weak-board__header-actions .undo-rating-button {
        position: relative;
        isolation: isolate;
        min-width: 0;
        min-height: 44px;
        height: 44px;
        padding: 0 8px;
        border: 0;
        color: #fff;
        background: transparent;
        font-size: 11px;
        white-space: nowrap;
    }

    .guided-study-session-page .weak-board__footer #detect-weak-page {
        width: 92px;
        flex: 0 0 92px;
    }

    .guided-study-session-page .weak-board__header-actions .undo-rating-button {
        width: 58px;
        color: var(--brand-dark);
    }

    .guided-study-session-page .weak-board__footer #detect-weak-page::before,
    .guided-study-session-page .weak-board__header-actions .undo-rating-button::before {
        position: absolute;
        z-index: -1;
        content: "";
        inset: 5px 2px;
        border: 1px solid var(--brand);
        border-radius: 5px;
        background: var(--brand);
    }

    .guided-study-session-page .weak-board__header-actions .undo-rating-button::before {
        border-color: var(--line);
        background: var(--surface-soft);
    }

    .guided-study-session-page .weak-board__footer #detect-weak-page:disabled {
        color: var(--muted);
    }

    .guided-study-session-page .weak-board__footer #detect-weak-page:disabled::before {
        border-color: var(--line);
        background: var(--surface-soft);
    }

    .guided-study-session-page .weak-board__words {
        min-height: 248px;
        height: 248px;
        grid-template-columns: minmax(0, 1fr);
        gap: 7px;
    }

    .guided-study-session-page .weak-board__word {
        min-height: 44px;
        height: 44px;
        padding: 8px 9px;
    }

    .guided-study-session-page .weak-board__word:nth-child(5):last-child {
        grid-column: auto;
    }

    .guided-study-session-page .weak-board__word strong {
        font-size: 17px;
    }

    .guided-study-session-page .weak-board__answer-panel {
        display: none;
        min-height: 0;
        height: 192px;
        max-height: 192px;
        margin-top: 12px;
        padding: 10px 4px 4px 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
        border-top: 1px solid var(--line);
        border-left: 0;
        -webkit-overflow-scrolling: touch;
    }

    .guided-study-session-page .weak-board.is-detail-view .weak-board__words {
        min-height: 44px;
        height: 44px;
    }

    .guided-study-session-page .weak-board.is-detail-view .weak-board__word {
        display: none;
    }

    .guided-study-session-page .weak-board.is-detail-view .weak-board__word.is-selected {
        display: grid;
    }

    .guided-study-session-page .weak-board.is-detail-view .weak-board__answer-panel {
        display: block;
    }

    .guided-study-session-page .weak-board__placeholder {
        min-height: 190px;
    }

    .guided-study-session-page .weak-board__detail {
        max-height: none;
        padding: 0;
        overflow: visible;
    }

    .guided-study-session-page .weak-board__detail-heading > strong {
        display: none;
    }

    .guided-study-session-page .weak-board__detail-heading {
        min-height: 38px;
        align-items: center;
        justify-content: flex-end;
        flex-direction: row;
    }

    .guided-study-session-page .weak-board__detail-actions {
        justify-content: flex-end;
        width: 100%;
    }

    .guided-study-session-page #weak-board-detail-meaning {
        font-size: 18px;
    }

    .guided-study-session-page .weak-board__detail-actions .secondary-button,
    .guided-study-session-page .weak-board__detail-actions .speak-button {
        position: relative;
        isolation: isolate;
        min-height: 44px;
        padding: 0 8px;
        border: 0;
        background: transparent;
        font-size: 11px;
    }

    .guided-study-session-page .weak-board__detail-actions .secondary-button::before,
    .guided-study-session-page .weak-board__detail-actions .speak-button::before {
        position: absolute;
        z-index: -1;
        content: "";
        inset: 6px 2px;
        border: 1px solid var(--line);
        border-radius: 5px;
        background: var(--surface-soft);
    }
}

@media (max-width: 520px) {
    .guided-study-session-page .study-header {
        grid-template-columns: auto minmax(52px, 1fr) auto;
        grid-template-areas:
            "back student progress"
            "theme actions actions";
        padding: 0 8px;
    }

    .guided-study-session-page .premium-study-header-actions {
        gap: 4px;
    }

    .guided-study-session-page .premium-study-header-actions .end-session-button {
        min-width: 58px;
        padding: 0 5px;
        font-size: 11px;
    }

    .guided-study-session-page .study-card-browser {
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        gap: 4px;
    }

    .guided-study-session-page #prompt-text[lang="en"] {
        font-size: 32px;
    }

    .guided-study-session-page #prompt-text[lang="en"].is-long-word {
        font-size: 28px;
    }

    .guided-study-session-page #prompt-text[lang="en"].is-very-long-word {
        font-size: 24px;
    }

    .guided-study-session-page .answer-example__english {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }

    .guided-study-session-page .example-speak-button {
        width: fit-content;
    }
}

/* Premium self-study session: keep the card and answer area stable. */
.premium-study-session-page {
    padding-bottom: 90px;
}

.premium-study-session-page .study-header {
    grid-template-columns: 140px minmax(0, 1fr) auto auto auto;
}

.premium-study-session-page .study-shell {
    grid-template-columns: 210px minmax(0, 1fr) 180px;
    gap: 14px;
}

.premium-study-session-page .study-context,
.premium-study-session-page .study-summary {
    padding: 17px;
}

.premium-study-session-page .study-stage {
    --premium-answer-height: clamp(240px, 34vh, 300px);
    align-self: start;
    min-height: 540px;
    padding: 18px 24px;
}

.premium-study-session-page .study-stage.has-active-card {
    min-height: 620px;
    height: calc(100vh - 158px);
    grid-template-rows: auto minmax(190px, 1fr) auto auto var(--premium-answer-height) auto;
}

.premium-study-session-page .study-stage.is-weak-board-view {
    height: auto;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.premium-study-session-page .study-phase-transition {
    inset: auto 18px 18px auto;
    width: min(560px, calc(100% - 36px));
    min-height: 0;
    padding: 16px 18px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
    grid-template-areas: "eyebrow actions" "title actions" "copy actions";
    align-content: center;
    justify-items: start;
    gap: 3px 16px;
    border: 1px solid #c7d8d0;
    box-shadow: 0 10px 24px rgba(21, 59, 48, .14);
    text-align: left;
}

.premium-study-session-page .study-phase-transition > span {
    grid-area: eyebrow;
    font-size: 11px;
}

.premium-study-session-page .study-phase-transition h2 {
    grid-area: title;
    max-width: none;
    margin: 0;
    font-size: 18px;
    line-height: 1.35;
}

.premium-study-session-page .study-phase-transition p {
    grid-area: copy;
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.premium-study-session-page .study-phase-transition .study-phase-actions {
    grid-area: actions;
    align-self: center;
    width: auto;
    flex-wrap: nowrap;
}

.premium-study-session-page .study-phase-transition .study-phase-actions .primary-button {
    min-width: 132px;
    min-height: 44px;
}

.premium-study-session-page .study-preferences {
    grid-template-columns: repeat(2, 176px);
    gap: 8px;
}

.premium-study-session-page .study-preferences .study-direction {
    width: 176px;
    padding: 2px;
}

.premium-study-session-page .study-preferences .study-direction button {
    min-height: 30px;
    font-size: 12px;
}

.premium-study-session-page .prompt-area {
    padding: 18px 0 10px;
}

.premium-study-session-page #prompt-text {
    max-width: 920px;
    font-size: 40px;
    line-height: 1.32;
    letter-spacing: 0;
}

.premium-study-session-page #prompt-text[lang="en"] {
    font-size: 68px;
    line-height: 1.12;
}

.premium-study-session-page .answer-slot {
    min-width: 0;
    min-height: var(--premium-answer-height);
    height: var(--premium-answer-height);
}

.premium-study-session-page .answer-slot[hidden] {
    display: none;
}

.premium-study-session-page .answer-area {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    padding: 18px 24px;
}

.premium-study-session-page #answer-primary {
    max-width: 860px;
    font-size: 25px;
    line-height: 1.52;
    letter-spacing: 0;
}

.premium-study-session-page #answer-primary[lang="en"] {
    font-size: 44px;
    line-height: 1.2;
}

.premium-study-session-page .answer-area p {
    font-size: 14px;
}

.premium-study-session-page .answer-examples {
    width: min(860px, 100%);
    margin-top: 15px;
    gap: 11px;
}

.premium-study-session-page .answer-example {
    padding-left: 14px;
}

.premium-study-session-page .answer-example span {
    font-size: 17px;
    line-height: 1.5;
}

.premium-study-session-page .answer-example small {
    margin-top: 4px;
    font-size: 15px;
    line-height: 1.48;
}

.premium-study-session-page .study-tools {
    min-height: 44px;
    gap: 7px;
}

.premium-study-session-page .reveal-button,
.premium-study-session-page .undo-rating-button,
.premium-study-session-page .speak-button,
.premium-study-session-page #premium-finish-screening,
.premium-study-session-page #premium-return-to-board {
    min-width: 0;
    min-height: 34px;
    padding: 0 11px;
    font-size: 12px;
}

.premium-study-session-page .undo-rating-button:disabled {
    border-color: var(--line);
    color: var(--muted);
    background: var(--surface-soft);
    cursor: not-allowed;
    opacity: .68;
}

.premium-study-session-page .rating-bar {
    min-height: 72px;
    padding: 8px max(22px, calc((100% - 760px) / 2));
    gap: 10px;
}

.premium-study-session-page .rating-button {
    min-height: 52px;
    padding: 6px 12px;
}

.premium-study-session-page .rating-button strong {
    font-size: 17px;
}

.premium-study-session-page .rating-button span {
    display: none;
}

.premium-study-session-page .guided-weak-list {
    position: relative;
}

.premium-study-session-page .guided-weak-list ol {
    min-height: 190px;
    height: 190px;
}

.premium-study-session-page .guided-weak-list > p {
    position: absolute;
    top: 48px;
    right: 8px;
    left: 8px;
    margin: 0;
    text-align: center;
}

.premium-study-session-page .weak-board {
    gap: 12px;
}

.premium-study-session-page .weak-board__workspace {
    min-width: 0;
    min-height: 350px;
    display: grid;
    grid-template-columns: minmax(210px, 270px) minmax(0, 1fr);
    gap: 20px;
}

.premium-study-session-page .weak-board__list-panel {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 10px;
}

.premium-study-session-page .weak-board__pages {
    min-height: 34px;
}

.premium-study-session-page .weak-board__pages button {
    min-height: 32px;
}

.premium-study-session-page .weak-board__words {
    grid-template-columns: 1fr;
    gap: 8px;
}

.premium-study-session-page .weak-board__word {
    min-height: 56px;
    padding: 9px 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    align-content: center;
    justify-items: stretch;
    gap: 10px;
    text-align: left;
}

.premium-study-session-page .weak-board__word strong {
    font-size: 20px;
    line-height: 1.2;
    text-align: left;
}

.premium-study-session-page .weak-board__word small {
    font-size: 11px;
    white-space: nowrap;
}

.premium-study-session-page .weak-board__answer-panel {
    min-width: 0;
    min-height: 350px;
    padding-left: 20px;
    border-left: 1px solid var(--line);
}

.premium-study-session-page .weak-board__placeholder {
    min-height: 350px;
    display: grid;
    align-content: center;
    justify-items: center;
    color: var(--muted);
    text-align: center;
}

.premium-study-session-page .weak-board__placeholder[hidden] {
    display: none;
}

.premium-study-session-page .weak-board__placeholder span,
.premium-study-session-page .weak-board__placeholder strong {
    display: block;
}

.premium-study-session-page .weak-board__placeholder span {
    font-size: 11px;
}

.premium-study-session-page .weak-board__placeholder strong {
    margin-top: 5px;
    color: var(--ink);
    font-size: 17px;
}

.premium-study-session-page .weak-board__detail {
    min-height: 0;
    padding: 4px 0 0;
    border-top: 0;
    border-bottom: 0;
}

.premium-study-session-page .weak-board__detail-heading {
    align-items: flex-start;
}

.premium-study-session-page .weak-board__detail-heading > strong {
    font-size: 34px;
    line-height: 1.2;
}

.premium-study-session-page .weak-board__detail > p {
    margin: 7px 0 12px;
    font-size: 14px;
}

.premium-study-session-page #premium-detail-meaning {
    overflow-wrap: anywhere;
    font-size: 20px;
    line-height: 1.55;
}

.premium-study-session-page .weak-board__detail .answer-examples {
    margin-top: 18px;
}

.premium-study-session-page .weak-board__detail-actions .secondary-button,
.premium-study-session-page .weak-board__detail-actions .speak-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
}

@media (max-width: 1180px) {
    .premium-study-session-page .weak-board__workspace {
        min-height: 0;
        display: block;
    }

    .premium-study-session-page .weak-board__words {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .premium-study-session-page .weak-board__word:nth-child(5):last-child {
        grid-column: 1 / -1;
    }

    .premium-study-session-page .weak-board__answer-panel {
        min-height: 260px;
        margin-top: 14px;
        padding: 16px 0 0;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .premium-study-session-page .weak-board__detail {
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 980px) {
    .premium-study-session-page .study-shell {
        grid-template-columns: 180px minmax(0, 1fr);
    }

    .premium-study-session-page #prompt-text[lang="en"] {
        font-size: 56px;
    }

    .premium-study-session-page #prompt-text[lang="en"].is-long-word {
        font-size: 44px;
    }

    .premium-study-session-page #prompt-text[lang="en"].is-very-long-word {
        font-size: 38px;
    }
}

@media (max-width: 767px) {
    .premium-study-session-page .study-header {
        grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    }

    .premium-study-session-page {
        padding-bottom: 94px;
    }

    .premium-study-session-page.is-weak-board-mode {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .premium-study-session-page .study-shell {
        width: calc(100% - 16px);
        min-height: calc(100vh - 166px);
        margin-top: 8px;
        display: block;
    }

    .premium-study-session-page .study-context {
        margin-bottom: 8px;
        padding: 10px;
        gap: 8px;
    }

    .premium-study-session-page .guided-weak-list ol {
        display: flex;
        gap: 6px;
        width: 100%;
        min-width: 0;
        min-height: 36px;
        height: 36px;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 2px;
    }

    .premium-study-session-page .guided-weak-list {
        width: 100%;
        min-width: 0;
    }

    .premium-study-session-page .guided-weak-list li {
        flex: 0 0 auto;
        min-width: 132px;
    }

    .premium-study-session-page .guided-weak-list > p {
        top: 43px;
    }

    .premium-study-session-page .study-stage {
        --premium-answer-height: clamp(260px, 40vh, 340px);
        min-height: calc(100vh - 176px);
        padding: 12px;
    }

    .premium-study-session-page .study-stage.has-active-card {
        min-height: 640px;
        height: auto;
        grid-template-rows: auto minmax(150px, 1fr) auto auto var(--premium-answer-height) auto;
    }

    .premium-study-session-page .study-stage.is-weak-board-view {
        min-height: 0;
        grid-template-rows: auto auto auto;
    }

    .premium-study-session-page .study-phase-transition {
        inset: 12px;
        width: auto;
        padding: 20px 16px;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        grid-template-areas: "eyebrow" "title" "copy" "actions";
        justify-items: center;
        gap: 8px;
        text-align: center;
    }

    .premium-study-session-page .study-phase-transition h2 {
        font-size: 21px;
    }

    .premium-study-session-page .study-phase-transition p {
        margin: 0 0 6px;
        font-size: 13px;
    }

    .premium-study-session-page .study-phase-transition .study-phase-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .premium-study-session-page .study-phase-transition .study-phase-actions .primary-button,
    .premium-study-session-page .study-phase-transition .study-phase-actions .secondary-button {
        flex: 1 1 140px;
        min-width: 0;
        min-height: 44px;
    }

    .premium-study-session-page .study-preferences {
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .premium-study-session-page .study-preferences .study-direction {
        width: 100%;
    }

    .premium-study-session-page .study-preferences .study-direction button {
        min-height: 44px;
        padding: 0 4px;
        font-size: 12px;
    }

    .premium-study-session-page .prompt-area {
        padding: 15px 0 8px;
    }

    .premium-study-session-page #prompt-text {
        font-size: 30px;
        line-height: 1.35;
    }

    .premium-study-session-page #prompt-text[lang="en"] {
        font-size: 40px;
        line-height: 1.15;
    }

    .premium-study-session-page #prompt-text[lang="en"].is-long-word {
        font-size: 36px;
    }

    .premium-study-session-page #prompt-text[lang="en"].is-very-long-word {
        font-size: 32px;
    }

    .premium-study-session-page .answer-area {
        min-height: 0;
        max-height: none;
        padding: 14px 10px calc(92px + env(safe-area-inset-bottom));
    }

    .premium-study-session-page #answer-primary {
        font-size: 21px;
        line-height: 1.5;
    }

    .premium-study-session-page #answer-primary[lang="en"] {
        font-size: 34px;
        line-height: 1.2;
    }

    .premium-study-session-page .answer-example span {
        font-size: 15px;
    }

    .premium-study-session-page .answer-example small {
        font-size: 14px;
    }

    .premium-study-session-page .study-tools {
        height: 52px;
        min-height: 52px;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        align-items: center;
        gap: 2px;
    }

    .premium-study-session-page .study-tools .reveal-button,
    .premium-study-session-page .study-tools .undo-rating-button,
    .premium-study-session-page .study-tools .speak-button,
    .premium-study-session-page .study-tools #premium-finish-screening,
    .premium-study-session-page .study-tools #premium-return-to-board {
        position: relative;
        isolation: isolate;
        width: 100%;
        min-width: 0;
        min-height: 44px;
        height: 44px;
        padding: 0 4px;
        border: 0;
        color: var(--brand-dark);
        background: transparent;
        font-size: 11px;
        white-space: nowrap;
    }

    .premium-study-session-page .study-tools .reveal-button::before,
    .premium-study-session-page .study-tools .undo-rating-button::before,
    .premium-study-session-page .study-tools .speak-button::before,
    .premium-study-session-page .study-tools #premium-finish-screening::before,
    .premium-study-session-page .study-tools #premium-return-to-board::before {
        position: absolute;
        z-index: -1;
        content: "";
        inset: 6px 3px;
        border: 1px solid var(--line);
        border-radius: 5px;
        background: var(--surface-soft);
    }

    .premium-study-session-page .study-tools .reveal-button::before,
    .premium-study-session-page .study-tools #premium-finish-screening:not(:disabled)::before {
        border-color: var(--brand);
    }

    .premium-study-session-page .study-tools button:focus-visible {
        outline: 2px solid var(--gold);
        outline-offset: -6px;
    }

    .premium-study-session-page .study-tools button:disabled {
        color: var(--muted);
        opacity: .68;
    }

    .premium-study-session-page .example-speak-button {
        min-height: 44px;
    }

    .premium-study-session-page .rating-bar {
        min-height: 82px;
        padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
        gap: 7px;
    }

    .premium-study-session-page .rating-button {
        min-height: 54px;
        padding: 5px 3px;
    }

    .premium-study-session-page .rating-button strong {
        font-size: 16px;
    }

    .premium-study-session-page .weak-board__workspace {
        min-height: 292px;
        height: 292px;
        display: block;
    }

    .premium-study-session-page .weak-board__footer {
        height: 44px;
        min-height: 44px;
        gap: 6px;
    }

    .premium-study-session-page .weak-board__footer .study-status {
        min-height: 18px;
        overflow: hidden;
        color: var(--muted);
        font-size: 11px;
        line-height: 18px;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .premium-study-session-page .weak-board__footer #premium-detect-page,
    .premium-study-session-page .weak-board__header-actions .undo-rating-button {
        position: relative;
        isolation: isolate;
        min-width: 0;
        min-height: 44px;
        height: 44px;
        padding: 0 8px;
        border: 0;
        color: #fff;
        background: transparent;
        font-size: 11px;
        white-space: nowrap;
    }

    .premium-study-session-page .weak-board__footer #premium-detect-page {
        width: 92px;
        flex: 0 0 92px;
    }

    .premium-study-session-page .weak-board__header-actions .undo-rating-button {
        width: 58px;
        color: var(--brand-dark);
    }

    .premium-study-session-page .weak-board__footer #premium-detect-page::before,
    .premium-study-session-page .weak-board__header-actions .undo-rating-button::before {
        position: absolute;
        z-index: -1;
        content: "";
        inset: 5px 2px;
        border: 1px solid var(--brand);
        border-radius: 5px;
        background: var(--brand);
    }

    .premium-study-session-page .weak-board__header-actions .undo-rating-button::before {
        border-color: var(--line);
        background: var(--surface-soft);
    }

    .premium-study-session-page .weak-board__footer #premium-detect-page:disabled {
        color: var(--muted);
    }

    .premium-study-session-page .weak-board__footer #premium-detect-page:disabled::before {
        border-color: var(--line);
        background: var(--surface-soft);
    }

    .premium-study-session-page .weak-board__words {
        min-height: 248px;
        height: 248px;
        grid-template-columns: minmax(0, 1fr);
        gap: 7px;
    }

    .premium-study-session-page .weak-board__word {
        min-height: 44px;
        height: 44px;
        padding: 8px 9px;
    }

    .premium-study-session-page .weak-board__word:nth-child(5):last-child {
        grid-column: auto;
    }

    .premium-study-session-page .weak-board__word strong {
        font-size: 17px;
    }

    .premium-study-session-page .weak-board__answer-panel {
        display: none;
        min-height: 0;
        height: 192px;
        max-height: 192px;
        margin-top: 12px;
        padding: 10px 4px 4px 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
        border-top: 1px solid var(--line);
        border-left: 0;
        -webkit-overflow-scrolling: touch;
    }

    .premium-study-session-page .weak-board.is-detail-view .weak-board__words {
        min-height: 44px;
        height: 44px;
    }

    .premium-study-session-page .weak-board.is-detail-view .weak-board__word {
        display: none;
    }

    .premium-study-session-page .weak-board.is-detail-view .weak-board__word.is-selected {
        display: grid;
    }

    .premium-study-session-page .weak-board.is-detail-view .weak-board__answer-panel {
        display: block;
    }

    .premium-study-session-page .weak-board__placeholder {
        min-height: 190px;
    }

    .premium-study-session-page .weak-board__detail {
        max-height: none;
        padding: 0;
        overflow: visible;
    }

    .premium-study-session-page .weak-board__detail-heading > strong {
        display: none;
    }

    .premium-study-session-page .weak-board__detail-heading {
        min-height: 38px;
        align-items: center;
        justify-content: flex-end;
        flex-direction: row;
    }

    .premium-study-session-page .weak-board__detail-actions {
        justify-content: flex-end;
        width: 100%;
    }

    .premium-study-session-page #premium-detail-meaning {
        font-size: 18px;
    }

    .premium-study-session-page .weak-board__detail-actions .secondary-button,
    .premium-study-session-page .weak-board__detail-actions .speak-button {
        position: relative;
        isolation: isolate;
        min-height: 44px;
        padding: 0 8px;
        border: 0;
        background: transparent;
        font-size: 11px;
    }

    .premium-study-session-page .weak-board__detail-actions .secondary-button::before,
    .premium-study-session-page .weak-board__detail-actions .speak-button::before {
        position: absolute;
        z-index: -1;
        content: "";
        inset: 6px 2px;
        border: 1px solid var(--line);
        border-radius: 5px;
        background: var(--surface-soft);
    }
}

@media (max-width: 520px) {
    .premium-study-session-page .study-header {
        grid-template-columns: auto minmax(52px, 1fr) auto auto;
        padding: 0 8px;
    }

    .premium-study-session-page .premium-study-header-actions {
        gap: 4px;
    }

    .premium-study-session-page .premium-study-header-actions .end-session-button {
        min-width: 58px;
        padding: 0 5px;
        font-size: 11px;
    }

    .premium-study-session-page .study-card-browser {
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        gap: 4px;
    }

    .premium-study-session-page #prompt-text[lang="en"] {
        font-size: 32px;
    }

    .premium-study-session-page #prompt-text[lang="en"].is-long-word {
        font-size: 28px;
    }

    .premium-study-session-page #prompt-text[lang="en"].is-very-long-word {
        font-size: 24px;
    }

    .premium-study-session-page .answer-example__english {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }

    .premium-study-session-page .example-speak-button {
        width: fit-content;
    }
}

/* Immersive learning interfaces: shared behavior, fully themed presentation. */
html[data-theme="dragoncourt"] .study-page,
html[data-theme="dragoncourt"] .practice-page,
html[data-theme="dragoncourt"] .growth-page,
html[data-theme="dragoncourt"] .learning-theme-page {
    --ink: #422d25;
    --muted: #80675a;
    --line: rgba(142, 94, 65, .24);
    --surface: rgba(255, 252, 247, .78);
    --surface-soft: rgba(255, 246, 236, .66);
    --page: #f1dfc9;
    --brand: #b94a35;
    --brand-dark: #8f3026;
    --brand-soft: #f8ded5;
    --gold: #bd842b;
    --danger: #a33b32;
    --danger-soft: #f5dfdb;
    --theme-panel: rgba(255, 250, 242, .54);
    --theme-panel-strong: rgba(255, 252, 247, .90);
    --theme-control: rgba(255, 247, 238, .68);
    --theme-overlay-line: rgba(136, 87, 58, .24);
    --theme-companion-image: url("../images/dragon-young.webp");
}

html[data-theme="skyrealm"] .study-page,
html[data-theme="skyrealm"] .practice-page,
html[data-theme="skyrealm"] .growth-page,
html[data-theme="skyrealm"] .learning-theme-page {
    --ink: #17323b;
    --muted: #5b737a;
    --line: rgba(76, 132, 139, .28);
    --surface: rgba(243, 249, 248, .82);
    --surface-soft: rgba(225, 239, 238, .72);
    --page: #092131;
    --brand: #b84750;
    --brand-dark: #8e303d;
    --brand-soft: #f5e3e4;
    --gold: #b68735;
    --danger: #a33c49;
    --danger-soft: #f5e3e5;
    --theme-panel: rgba(235, 246, 244, .68);
    --theme-panel-strong: rgba(249, 252, 250, .91);
    --theme-control: rgba(226, 239, 238, .74);
    --theme-overlay-line: rgba(79, 139, 146, .30);
    --theme-companion-image: url("../images/dragon-young.webp");
}

html[data-theme="dragoncourt"] .study-page,
html[data-theme="dragoncourt"] .practice-page,
html[data-theme="dragoncourt"] .growth-page,
html[data-theme="dragoncourt"] .learning-theme-page {
    min-height: 100vh;
    background-color: #f1dfc9;
    background-image: url("../images/bg-academy-mountains.webp");
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

html[data-theme="skyrealm"] .study-page,
html[data-theme="skyrealm"] .practice-page,
html[data-theme="skyrealm"] .growth-page,
html[data-theme="skyrealm"] .learning-theme-page {
    min-height: 100vh;
    background-color: #092131;
    background-image: url("../images/bg-moonlit-academy.webp");
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

html[data-theme="dragoncourt"] .study-page .study-header,
html[data-theme="skyrealm"] .study-page .study-header {
    border: 1px solid var(--theme-overlay-line);
    background: var(--theme-panel);
    box-shadow: 0 12px 34px rgba(52, 36, 27, .13);
    -webkit-backdrop-filter: blur(14px) saturate(1.14);
    backdrop-filter: blur(14px) saturate(1.14);
}

html[data-theme="skyrealm"] .study-page .study-header {
    background: rgba(236, 246, 244, .76);
    box-shadow: 0 14px 38px rgba(2, 18, 30, .25);
}

html[data-theme="dragoncourt"] .study-page .study-back img,
html[data-theme="skyrealm"] .study-page .study-back img {
    width: 46px;
    height: 46px;
    object-fit: contain;
    object-position: center;
    border: 0;
    background: transparent;
}

html[data-theme="dragoncourt"] .study-page .study-back img,
html[data-theme="skyrealm"] .study-page .study-back img {
    content: url("../images/dragon-young.webp");
}

html[data-theme="dragoncourt"] .study-page .study-context,
html[data-theme="dragoncourt"] .study-page .study-summary,
html[data-theme="dragoncourt"] .study-page .study-stage,
html[data-theme="skyrealm"] .study-page .study-context,
html[data-theme="skyrealm"] .study-page .study-summary,
html[data-theme="skyrealm"] .study-page .study-stage {
    border-color: var(--theme-overlay-line);
    background: var(--theme-panel);
    -webkit-backdrop-filter: blur(16px) saturate(1.12);
    backdrop-filter: blur(16px) saturate(1.12);
}

html[data-theme="dragoncourt"] .study-page .study-context,
html[data-theme="dragoncourt"] .study-page .study-summary {
    background: rgba(255, 250, 242, .52);
    box-shadow: 0 18px 42px rgba(80, 54, 37, .12);
}

html[data-theme="dragoncourt"] .study-page .study-stage {
    background: rgba(255, 251, 244, .64);
    box-shadow: 0 22px 58px rgba(80, 52, 34, .15), inset 0 1px 0 rgba(255, 255, 255, .66);
}

html[data-theme="skyrealm"] .study-page .study-context,
html[data-theme="skyrealm"] .study-page .study-summary {
    background: rgba(235, 246, 244, .70);
    box-shadow: 0 18px 48px rgba(1, 20, 31, .24), inset 0 1px 0 rgba(255, 255, 255, .68);
}

html[data-theme="skyrealm"] .study-page .study-stage {
    background: rgba(242, 249, 248, .78);
    box-shadow: 0 24px 64px rgba(1, 18, 31, .30), inset 0 1px 0 rgba(255, 255, 255, .82);
}

html[data-theme="dragoncourt"] .study-page .study-direction,
html[data-theme="dragoncourt"] .study-page .study-task-stats,
html[data-theme="dragoncourt"] .study-page .guided-weak-list li,
html[data-theme="dragoncourt"] .study-page .weak-board__word,
html[data-theme="skyrealm"] .study-page .study-direction,
html[data-theme="skyrealm"] .study-page .study-task-stats,
html[data-theme="skyrealm"] .study-page .guided-weak-list li,
html[data-theme="skyrealm"] .study-page .weak-board__word {
    border-color: var(--theme-overlay-line);
    background: var(--theme-control);
}

html[data-theme="dragoncourt"] .study-page .study-direction button.is-active,
html[data-theme="skyrealm"] .study-page .study-direction button.is-active,
html[data-theme="dragoncourt"] .study-page .weak-board__word.is-selected,
html[data-theme="skyrealm"] .study-page .weak-board__word.is-selected {
    color: var(--brand-dark);
    background: var(--theme-panel-strong);
    box-shadow: 0 4px 14px rgba(25, 23, 38, .14);
}

html[data-theme="dragoncourt"] .study-page .prompt-area h1,
html[data-theme="dragoncourt"] .study-page .answer-example span,
html[data-theme="dragoncourt"] .study-page .weak-board__word strong,
html[data-theme="skyrealm"] .study-page .prompt-area h1,
html[data-theme="skyrealm"] .study-page .answer-example span,
html[data-theme="skyrealm"] .study-page .weak-board__word strong {
    color: var(--ink);
}

html[data-theme="dragoncourt"] .study-page .prompt-area h1 {
    color: #b3412f;
    text-shadow: 0 2px 0 rgba(255, 255, 255, .64);
}

html[data-theme="skyrealm"] .study-page .prompt-area h1 {
    color: #ad3f4a;
    text-shadow: 0 2px 0 rgba(255, 255, 255, .68);
}

html[data-theme="dragoncourt"] .study-page .answer-area,
html[data-theme="dragoncourt"] .study-page .weak-board__answer-panel,
html[data-theme="skyrealm"] .study-page .answer-area,
html[data-theme="skyrealm"] .study-page .weak-board__answer-panel {
    border-color: var(--theme-overlay-line);
    background: rgba(255, 255, 255, .18);
}

html[data-theme="skyrealm"] .study-page .answer-area,
html[data-theme="skyrealm"] .study-page .weak-board__answer-panel {
    background: rgba(246, 251, 250, .48);
}

html[data-theme="dragoncourt"] .study-page .answer-slot,
html[data-theme="skyrealm"] .study-page .answer-slot {
    position: relative;
    isolation: isolate;
}

html[data-theme="dragoncourt"] .study-page .study-stage.has-active-card .answer-slot::before,
html[data-theme="skyrealm"] .study-page .study-stage.has-active-card .answer-slot::before {
    position: absolute;
    z-index: 0;
    content: "";
    left: 50%;
    bottom: 2px;
    width: clamp(150px, 18vw, 210px);
    height: calc(100% - 4px);
    max-height: 238px;
    pointer-events: none;
    background-image: var(--theme-companion-image);
    background-position: center bottom;
    background-repeat: no-repeat;
    background-size: contain;
    filter: drop-shadow(0 14px 17px rgba(62, 46, 37, .17));
    opacity: .98;
    transform: translateX(-50%);
    transform-origin: center bottom;
    transition: opacity .18s ease, transform .18s ease;
    animation: immersive-companion-float 4.8s ease-in-out infinite;
}

html[data-theme="skyrealm"] .study-page .study-stage.has-active-card .answer-slot::before {
    filter: drop-shadow(0 14px 20px rgba(12, 72, 91, .22));
}

html[data-theme="dragoncourt"] .study-page .study-stage.is-answer-visible .answer-slot::before,
html[data-theme="skyrealm"] .study-page .study-stage.is-answer-visible .answer-slot::before {
    opacity: 0;
    transform: translateX(-50%) translateY(8px) scale(.98);
    animation: none;
}

html[data-theme="dragoncourt"] .study-page .answer-area,
html[data-theme="skyrealm"] .study-page .answer-area {
    position: relative;
    z-index: 1;
}

@keyframes immersive-companion-float {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-5px); }
}

html[data-theme="dragoncourt"] .study-page .study-word-nav,
html[data-theme="dragoncourt"] .study-page .reveal-button,
html[data-theme="dragoncourt"] .study-page .undo-rating-button,
html[data-theme="dragoncourt"] .study-page .speak-button,
html[data-theme="dragoncourt"] .study-page .secondary-button,
html[data-theme="dragoncourt"] .study-page .end-session-button,
html[data-theme="skyrealm"] .study-page .study-word-nav,
html[data-theme="skyrealm"] .study-page .reveal-button,
html[data-theme="skyrealm"] .study-page .undo-rating-button,
html[data-theme="skyrealm"] .study-page .speak-button,
html[data-theme="skyrealm"] .study-page .secondary-button,
html[data-theme="skyrealm"] .study-page .end-session-button {
    border-color: var(--theme-overlay-line);
    color: var(--brand-dark);
    background: var(--theme-control);
}

html[data-theme="dragoncourt"] .study-page .study-word-nav:hover:not(:disabled),
html[data-theme="skyrealm"] .study-page .study-word-nav:hover:not(:disabled) {
    border-color: var(--brand);
    color: #fff;
    background: var(--brand);
}

html[data-theme="dragoncourt"] .study-page .study-word-nav:disabled,
html[data-theme="skyrealm"] .study-page .study-word-nav:disabled,
html[data-theme="dragoncourt"] .study-page .undo-rating-button:disabled,
html[data-theme="skyrealm"] .study-page .undo-rating-button:disabled {
    border-color: var(--line);
    color: var(--muted);
    background: var(--surface-soft);
}

html[data-theme="dragoncourt"] .study-page .rating-bar,
html[data-theme="skyrealm"] .study-page .rating-bar {
    border-color: var(--theme-overlay-line);
    background: rgba(255, 255, 255, .22);
}

html[data-theme="skyrealm"] .study-page .rating-bar {
    background: rgba(232, 243, 242, .58);
}

html[data-theme="dragoncourt"] .study-page .rating-button--unknown {
    border-color: #d56859;
    color: #8f281e;
    background: rgba(255, 221, 212, .88);
}

html[data-theme="dragoncourt"] .study-page .rating-button--hesitant {
    border-color: #d9a33a;
    color: #7d510d;
    background: rgba(255, 239, 196, .88);
}

html[data-theme="dragoncourt"] .study-page .rating-button--skilled {
    border-color: #6caa72;
    color: #27612d;
    background: rgba(221, 243, 214, .90);
}

html[data-theme="skyrealm"] .study-page .rating-button--unknown {
    border-color: #c77b82;
    color: #8e303d;
    background: rgba(247, 226, 228, .92);
}

html[data-theme="skyrealm"] .study-page .rating-button--hesitant {
    border-color: #d1ad62;
    color: #725111;
    background: rgba(249, 239, 212, .92);
}

html[data-theme="skyrealm"] .study-page .rating-button--skilled {
    border-color: #63a5a3;
    color: #14686d;
    background: rgba(217, 239, 237, .92);
}

html[data-theme="dragoncourt"] .study-page .study-phase-transition,
html[data-theme="dragoncourt"] .study-page .premium-study-completion,
html[data-theme="skyrealm"] .study-page .study-phase-transition,
html[data-theme="skyrealm"] .study-page .premium-study-completion {
    border-color: var(--theme-overlay-line);
    background: var(--theme-panel-strong);
    box-shadow: 0 18px 46px rgba(11, 17, 38, .24);
}

html[data-theme="skyrealm"] .study-page .previous-weak-badge,
html[data-theme="skyrealm"] .study-page .carryover-summary {
    border-color: #c8a45f;
    color: #705014;
    background: rgba(250, 241, 216, .92);
}

html[data-theme="dragoncourt"] .learning-theme-popover,
html[data-theme="skyrealm"] .learning-theme-popover {
    border-color: var(--theme-overlay-line);
    background: var(--theme-panel-strong);
    -webkit-backdrop-filter: blur(18px) saturate(1.12);
    backdrop-filter: blur(18px) saturate(1.12);
}

html[data-theme="dragoncourt"] .learning-theme-trigger,
html[data-theme="skyrealm"] .learning-theme-trigger {
    border-color: var(--theme-overlay-line);
    background: var(--theme-control);
}

@media (max-width: 767px) {
    html[data-theme="dragoncourt"] .study-page,
    html[data-theme="dragoncourt"] .practice-page,
    html[data-theme="dragoncourt"] .growth-page,
    html[data-theme="dragoncourt"] .learning-theme-page,
    html[data-theme="skyrealm"] .study-page,
    html[data-theme="skyrealm"] .practice-page,
    html[data-theme="skyrealm"] .growth-page,
    html[data-theme="skyrealm"] .learning-theme-page {
        background-attachment: scroll;
        background-position: center top;
    }

    html[data-theme="dragoncourt"] .study-page,
    html[data-theme="dragoncourt"] .practice-page,
    html[data-theme="dragoncourt"] .growth-page,
    html[data-theme="dragoncourt"] .learning-theme-page {
        background-position: right top;
    }

    html[data-theme="skyrealm"] .study-page,
    html[data-theme="skyrealm"] .practice-page,
    html[data-theme="skyrealm"] .growth-page,
    html[data-theme="skyrealm"] .learning-theme-page {
        background-position: 78% top;
    }

    html[data-theme="dragoncourt"] .study-page {
        --theme-control: rgba(255, 247, 238, .52);
    }

    html[data-theme="skyrealm"] .study-page {
        --theme-control: rgba(226, 239, 238, .58);
    }

    html[data-theme="dragoncourt"] .study-page .study-header,
    html[data-theme="skyrealm"] .study-page .study-header {
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    html[data-theme="dragoncourt"] .study-page .study-header {
        background: rgba(255, 250, 242, .40);
    }

    html[data-theme="skyrealm"] .study-page .study-header {
        background: rgba(236, 246, 244, .50);
    }

    html[data-theme="dragoncourt"] .study-page .study-context,
    html[data-theme="dragoncourt"] .study-page .study-summary {
        background: rgba(255, 250, 242, .38);
    }

    html[data-theme="dragoncourt"] .study-page .study-stage {
        background: rgba(255, 251, 244, .46);
    }

    html[data-theme="skyrealm"] .study-page .study-context,
    html[data-theme="skyrealm"] .study-page .study-summary {
        background: rgba(235, 246, 244, .48);
    }

    html[data-theme="skyrealm"] .study-page .study-stage {
        background: rgba(242, 249, 248, .56);
    }

    html[data-theme="dragoncourt"] .study-page .study-context,
    html[data-theme="dragoncourt"] .study-page .study-stage,
    html[data-theme="skyrealm"] .study-page .study-context,
    html[data-theme="skyrealm"] .study-page .study-stage {
        -webkit-backdrop-filter: blur(7px) saturate(1.08);
        backdrop-filter: blur(7px) saturate(1.08);
    }

    html[data-theme="dragoncourt"] .study-page .study-stage.has-active-card .answer-slot::before,
    html[data-theme="skyrealm"] .study-page .study-stage.has-active-card .answer-slot::before {
        top: 12px;
        bottom: auto;
        width: 142px;
        max-height: 210px;
    }

    html[data-theme="dragoncourt"] .study-page .study-back img,
    html[data-theme="skyrealm"] .study-page .study-back img {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 520px) {
    html[data-theme="dragoncourt"] .study-page .study-stage.has-active-card .answer-slot::before,
    html[data-theme="skyrealm"] .study-page .study-stage.has-active-card .answer-slot::before {
        width: 128px;
        max-height: 188px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html[data-theme="dragoncourt"] .study-page .study-stage.has-active-card .answer-slot::before,
    html[data-theme="skyrealm"] .study-page .study-stage.has-active-card .answer-slot::before {
        animation: none;
    }
}

@media (max-width: 767px) {
    .guided-study-session-page.is-weak-board-mode .study-shell,
    .premium-study-session-page.is-weak-board-mode .study-shell {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .guided-study-session-page.is-weak-board-mode .study-stage,
    .premium-study-session-page.is-weak-board-mode .study-stage {
        width: 100%;
        order: 1;
    }

    .guided-study-session-page.is-weak-board-mode .study-context,
    .premium-study-session-page.is-weak-board-mode .study-context {
        width: 100%;
        order: 2;
        margin-top: 8px;
        margin-bottom: 0;
    }

    .guided-study-session-page.is-weak-board-mode .study-context .guided-weak-list,
    .premium-study-session-page.is-weak-board-mode .study-context .guided-weak-list,
    .guided-study-session-page .weak-board__header > div:first-child,
    .premium-study-session-page .weak-board__header > div:first-child,
    .guided-study-session-page .weak-board__footer .study-status,
    .premium-study-session-page .weak-board__footer .study-status {
        display: none;
    }

    .guided-study-session-page .weak-board,
    .premium-study-session-page .weak-board {
        gap: 0;
    }

    .guided-study-session-page .weak-board__header,
    .premium-study-session-page .weak-board__header {
        min-height: 0;
        justify-content: flex-end;
        gap: 0;
    }

    .guided-study-session-page .weak-board__header-actions,
    .premium-study-session-page .weak-board__header-actions {
        margin-left: 0;
    }

    .guided-study-session-page .weak-board__workspace,
    .premium-study-session-page .weak-board__workspace {
        min-height: 300px;
        height: 300px;
    }

    .guided-study-session-page .weak-board__words,
    .premium-study-session-page .weak-board__words {
        min-height: 256px;
        height: 256px;
        gap: 4px;
    }

    .guided-study-session-page .weak-board__word,
    .premium-study-session-page .weak-board__word {
        min-height: 48px;
        height: 48px;
        padding: 7px 10px;
    }

    .guided-study-session-page .weak-board__word strong,
    .premium-study-session-page .weak-board__word strong {
        font-size: 22px;
    }

    .guided-study-session-page .weak-board__word.is-long-word strong,
    .premium-study-session-page .weak-board__word.is-long-word strong {
        font-size: 19px;
    }

    .guided-study-session-page .weak-board__word.is-very-long-word strong,
    .premium-study-session-page .weak-board__word.is-very-long-word strong {
        font-size: 17px;
    }

    .guided-study-session-page .weak-board.is-detail-view .weak-board__words,
    .premium-study-session-page .weak-board.is-detail-view .weak-board__words,
    .guided-study-session-page .weak-board.is-detail-view .weak-board__word.is-selected,
    .premium-study-session-page .weak-board.is-detail-view .weak-board__word.is-selected {
        min-height: 56px;
        height: 56px;
    }

    .guided-study-session-page .weak-board.is-detail-view .weak-board__workspace,
    .premium-study-session-page .weak-board.is-detail-view .weak-board__workspace {
        min-height: 372px;
        height: 372px;
    }

    .guided-study-session-page .weak-board.is-detail-view .weak-board__answer-panel,
    .premium-study-session-page .weak-board.is-detail-view .weak-board__answer-panel {
        height: 260px;
        max-height: 260px;
    }

    .guided-study-session-page .weak-board.is-detail-view .weak-board__word.is-selected,
    .premium-study-session-page .weak-board.is-detail-view .weak-board__word.is-selected {
        border-color: var(--theme-overlay-line, var(--line));
        background: var(--theme-control, var(--surface-soft));
        box-shadow: none;
    }

    .guided-study-session-page .weak-board.is-detail-view .weak-board__word.is-selected:focus-visible,
    .premium-study-session-page .weak-board.is-detail-view .weak-board__word.is-selected:focus-visible {
        outline: 2px solid var(--gold);
        outline-offset: -3px;
    }

    .guided-study-session-page .weak-board.is-detail-view .weak-board__word.is-selected strong,
    .premium-study-session-page .weak-board.is-detail-view .weak-board__word.is-selected strong {
        font-size: 26px;
    }

    .guided-study-session-page .weak-board.is-detail-view .weak-board__word.is-selected.is-long-word strong,
    .premium-study-session-page .weak-board.is-detail-view .weak-board__word.is-selected.is-long-word strong {
        font-size: 22px;
    }

    .guided-study-session-page .weak-board.is-detail-view .weak-board__word.is-selected.is-very-long-word strong,
    .premium-study-session-page .weak-board.is-detail-view .weak-board__word.is-selected.is-very-long-word strong {
        font-size: 19px;
    }

    .guided-study-session-page .weak-board__footer,
    .premium-study-session-page .weak-board__footer {
        justify-content: center;
    }

    .guided-study-session-page .study-stage.is-weak-board-view,
    .premium-study-session-page .study-stage.is-weak-board-view {
        padding-bottom: 2px;
    }

    .guided-study-session-page .weak-board__footer #detect-weak-page,
    .premium-study-session-page .weak-board__footer #premium-detect-page {
        width: 96px;
        flex: 0 0 96px;
    }

    .guided-study-session-page .weak-board__footer #detect-weak-page::before,
    .premium-study-session-page .weak-board__footer #premium-detect-page::before {
        inset: 7px 5px;
    }
}
