/* Secondary screens: shared tokens come from reperes.css, only under the flag. */
body.ui-reperes :is(.rp-secondary-page, .auth-page),
body.ui-reperes :is(.rp-secondary-page, .auth-page) * {
    min-width: 0;
    box-sizing: border-box;
    overflow-wrap: anywhere;
}
body.ui-reperes:has(.rp-secondary-page) :is(.main-content, .main-public, .rp-shell-inner) {
    padding-inline: max(calc(1 * var(--ui-unit)), env(safe-area-inset-left, 0px)) max(calc(1 * var(--ui-unit)), env(safe-area-inset-right, 0px));
}
body.ui-reperes:has(.rp-secondary-page) .rp-nav a {
    font-size: calc(0.875 * var(--ui-unit) * min(var(--text-scale, 1), 1.3));
    padding-inline: calc(0.25 * var(--ui-unit));
}
body.ui-reperes :is(.rp-secondary-page, .auth-page) :is(.btn, button, a, label, select) {
    white-space: normal;
    text-overflow: clip;
    overflow: visible;
}
body.ui-reperes :is(.rp-secondary-page, .auth-page) :is(.btn, button, a) {
    min-height: 44px;
    max-width: 100%;
}
body.ui-reperes :is(.rp-secondary-page, .auth-page) :is(.btn, button) {
    height: auto;
    padding: 0.5rem calc(0.75 * var(--ui-unit));
    justify-content: center;
}
body.ui-reperes :is(.rp-secondary-page, .auth-page) a {
    text-decoration: underline;
    text-underline-offset: 0.2em;
}
body.ui-reperes :is(.rp-secondary-page, .auth-page) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea) {
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    height: auto;
    padding: 0.5rem calc(0.5 * var(--ui-unit));
    border: 2px solid var(--rp-text);
    background: var(--rp-bg);
    color: var(--rp-text);
    font-size: 1rem;
    line-height: 1.45;
}
body.ui-reperes :is(.rp-secondary-page, .auth-page) :is(input[type="checkbox"], input[type="radio"]) {
    flex-shrink: 0;
    min-width: 44px;
    min-height: 44px;
    accent-color: var(--rp-text);
}
body.ui-reperes :is(.rp-secondary-page, .auth-page) label {
    display: block;
    min-height: 44px;
}
body.ui-reperes :is(.rp-secondary-page, .auth-page) :is(.form-inline, .form-row, .toolbar-actions, .page-header, .lang-item, .toggle-label) {
    flex-wrap: wrap;
    gap: 0.5rem;
}
body.ui-reperes .rp-secondary-page :is(.card, .lang-item) {
    padding: 0;
    margin: 0 0 1.5rem;
    border: 0;
    border-bottom: 1px solid var(--rp-border);
    background: var(--rp-bg);
}
body.ui-reperes .rp-secondary-page :is(.grid-2, .vocab-list) { display: block; }
body.ui-reperes .rp-secondary-page :is(.vocab-table, svg) { display: none; }
body.ui-reperes .rp-secondary-page .page-header { text-align: start; }
body.ui-reperes .rp-secondary-page .settings-sheet {
    width: 100%;
    max-width: 40rem;
    max-height: 90dvh;
    margin: auto auto 0;
    padding: 0;
    border: 2px solid var(--rp-text);
    overflow-y: auto;
    animation: none;
}
body.ui-reperes .rp-secondary-page .settings-sheet-panel {
    padding: 1rem calc(1 * var(--ui-unit)) calc(1rem + env(safe-area-inset-bottom, 0px));
}
body.ui-reperes .rp-secondary-page .more-menu-header {
    flex-wrap: wrap;
    align-items: start;
    gap: 0.5rem;
}
body.ui-reperes .rp-secondary-page .settings-sheet :is(h2, h3) { font-size: 1.5rem; }
body.ui-reperes .rp-secondary-page .settings-sheet h2 { font-size: calc(1.5 * var(--rp-heading-unit)); }
body.ui-reperes .rp-secondary-page .settings-sheet .card { margin: 0; border: 0; }
body.ui-reperes .rp-secondary-page .settings-sheet .card > h3 { display: none; }
body.ui-reperes .rp-vocabulary :is(.vocab-group ul, .toolbar) { padding: 0; margin: 0; }
body.ui-reperes .rp-vocabulary .vocab-group ul { list-style: none; }
body.ui-reperes .rp-vocabulary .vocab-group-title {
    position: sticky;
    top: var(--rp-header-h);
    z-index: 1;
    margin: 0;
    padding: 0.75rem 0;
    font-size: calc(1 * var(--rp-heading-unit));
    background: var(--rp-bg);
    border-bottom: 1px solid var(--rp-text);
}
body.ui-reperes .rp-vocabulary .vocab-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    min-height: 56px;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--rp-border);
}
body.ui-reperes .rp-vocabulary .toolbar-actions .btn { flex: 1 1 auto; overflow-wrap: normal; }
body.ui-reperes .rp-vocabulary .vocab-word { flex: 1 1 min-content; }
body.ui-reperes .rp-vocabulary .vocab-word > * { display: block; overflow-wrap: normal; }
body.ui-reperes .rp-vocabulary .vocab-state { max-width: 100%; font-size: 0.875rem; }
body.ui-reperes .rp-vocabulary .vocab-row button { min-width: 44px; }
body.ui-reperes .rp-vocabulary:has(#add-form:not(.hidden)) [data-click="showAddForm"] {
    background: var(--rp-bg) !important;
    color: var(--rp-text) !important;
    border: 0;
    text-decoration: underline;
}
body.ui-reperes .rp-vocabulary .add-form { background: var(--rp-bg); padding-inline: 0; }
body.ui-reperes .rp-profile :is(.rp-setting-row, .rp-tools a) {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 56px;
    padding: 0.75rem 0;
    border: 0;
    border-bottom: 1px solid var(--rp-border);
    background: var(--rp-bg);
    color: var(--rp-text);
    text-align: start;
    font-size: 1rem;
    line-height: 1.45;
}
body.ui-reperes .rp-profile .rp-tools { margin-block: 2rem; }
body.ui-reperes .rp-profile .rp-tools h2 { margin-bottom: 0.75rem; }
body.ui-reperes .rp-profile .lang-item { min-height: 56px; padding-block: 0.5rem; }
body.ui-reperes .rp-profile .lang-active { font-weight: 700; }
body.ui-reperes .rp-profile :is(.badge, .language-code) {
    background: transparent;
    color: var(--rp-text);
    padding-inline: 0;
}
body.ui-reperes .rp-profile :is(a.btn-primary, #notif-btn.btn-primary),
body.ui-reperes .rp-profile :is(a.btn-primary, #notif-btn.btn-primary):hover {
    background: var(--rp-bg) !important;
    color: var(--rp-text) !important;
    border: 0;
    text-decoration: underline;
}
body.ui-reperes .rp-profile .modal-content {
    width: 100%;
    max-width: 40rem;
    max-height: 90dvh;
    overflow-y: auto;
}
body.ui-reperes.rp-auth .auth-page {
    display: block;
    min-height: 100dvh;
    padding: calc(1.5rem + env(safe-area-inset-top, 0px)) max(calc(1 * var(--ui-unit)), env(safe-area-inset-right, 0px)) calc(1.5rem + env(safe-area-inset-bottom, 0px)) max(calc(1 * var(--ui-unit)), env(safe-area-inset-left, 0px));
}
body.ui-reperes.rp-auth .auth-card {
    width: 100%;
    max-width: 40rem;
    padding: 0;
    margin: 0;
    border: 0;
    background: var(--rp-bg);
}
body.ui-reperes.rp-auth .auth-card h1 { text-align: start; margin-block: 1.5rem; color: var(--rp-text); }
body.ui-reperes.rp-auth .auth-card :is(p, .auth-link, div:has(> a)) { text-align: start; }
body.ui-reperes.rp-auth :is(.auth-link a, .ui-lang-link, .rp-auth-brand) { display: inline-flex; align-items: center; }
body.ui-reperes.rp-auth .rp-auth-brand { font-size: 1.5rem; font-weight: 700; }
body.ui-reperes.rp-auth .ui-lang-switch { justify-content: flex-start; flex-wrap: wrap; }
body.ui-reperes.rp-auth .auth-card a {
    display: inline-flex;
    align-items: center;
    min-width: 44px;
    color: var(--rp-text);
}
body.ui-reperes .rp-unsubscribed { max-width: 40rem; margin: 0; text-align: start; }
body.ui-reperes .rp-unsubscribed h1,
body.ui-reperes .rp-unsubscribed h1 span { color: var(--rp-text); }
@media (prefers-reduced-motion: reduce) {
    body.ui-reperes :is(.rp-secondary-page, .auth-page) * { transition: none !important; animation: none !important; }
}
body.ui-reperes .rp-profile :is([data-click="showDeleteModal"], #delete-modal button[type="submit"]) {
    background: var(--rp-bg);
    color: var(--rp-wrong);
    border: 2px solid var(--rp-wrong);
}
body.ui-reperes .rp-profile #rp-native-plans { scroll-margin-top: var(--rp-header-h); }
body.ui-reperes .rp-profile :is(.rp-accent-choices, .rp-voice-choices) {
    margin: 0;
    padding: 0.75rem 0;
    border: 0;
    border-bottom: 1px solid var(--rp-border);
}
body.ui-reperes .rp-profile :is(.rp-accent-option, .rp-voice-option) {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
body.ui-reperes .rp-profile .rp-accent-swatch {
    display: inline-block;
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    border: 1px solid var(--rp-text);
}
body.ui-reperes .rp-profile [data-accent-swatch="vert"] { background: var(--rp-accent-vert); }
body.ui-reperes .rp-profile [data-accent-swatch="bleu"] { background: var(--rp-accent-bleu); }
body.ui-reperes .rp-profile [data-accent-swatch="corail"] { background: var(--rp-accent-corail); }
body.ui-reperes .rp-profile [data-accent-swatch="violet"] { background: var(--rp-accent-violet); }
