/* Tarification visual consistency: intentionally scoped to salary pages.
   Keep this stylesheet after review_consistency.css: that file supplies global
   button styles which must not override the salary-specific design. */
:root {
    --r2-salary-control-height: 40px;
    --r2-salary-soft-border: #d6deeb;
}

/* Shared rhythm and form controls */
.salary-shell .salary-content-panel,
.r2-salary-data-workspace {
    min-width: 0;
}
.salary-shell .r2-salary-heading,
.r2-salary-data-workspace .r2-salary-data-heading {
    gap: 18px;
    margin-bottom: 20px;
}
.salary-shell .r2-salary-heading h1,
.r2-salary-data-workspace .r2-salary-data-heading h1 {
    letter-spacing: -.025em;
}
.salary-shell .r2-salary-heading .muted,
.r2-salary-data-workspace .r2-salary-data-heading p {
    max-width: 740px;
    line-height: 1.5;
}
.salary-shell :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea),
.r2-salary-data-workspace :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    max-width: 100%;
    min-width: 0;
}
.salary-shell .r2-salary-profile-section__head,
.r2-salary-data-workspace .r2-salary-profile-section__head {
    gap: 12px;
    margin-bottom: 13px;
}
.salary-shell .r2-save-state,
.r2-salary-data-workspace .r2-save-state {
    font-weight: 500;
    font-size: .77rem;
    white-space: nowrap;
}
.salary-shell .r2-save-state:is(.is-error,.is-conflict),
.r2-salary-data-workspace .r2-save-state:is(.is-error,.is-conflict) {
    font-weight: 750;
    white-space: normal;
}

/* Primary actions are blue, status/warnings remain semantically colored. */
body.r2-app .salary-shell :is(button.btn.primary, a.btn.primary, button.r2-button--primary, a.r2-button--primary),
body.r2-app .r2-salary-data-workspace :is(button.r2-button--primary, a.r2-button--primary),
body.r2-app .r2-individual-actions button.btn.primary {
    background: var(--r2-primary, #244d8d);
    border-color: var(--r2-primary, #244d8d);
    color: #fff !important;
    box-shadow: none;
}
body.r2-app .salary-shell :is(button.btn.primary, a.btn.primary, button.r2-button--primary, a.r2-button--primary):hover:not(:disabled),
body.r2-app .r2-salary-data-workspace :is(button.r2-button--primary, a.r2-button--primary):hover:not(:disabled) {
    background: var(--r2-primary-hover, #1b4078);
    border-color: var(--r2-primary-hover, #1b4078);
}

/* Existing period: link to immutable month before submitting duplicate. */
.r2-salary-create-period form { gap: 12px; }
.r2-salary-create-period__fields { align-items: end; }
.r2-period-existing-notice:not([hidden]) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #b8c9e5;
    border-left: 3px solid var(--r2-primary, #244d8d);
    background: #f4f7fc;
    border-radius: 7px;
}
.r2-period-existing-notice > div { display: grid; gap: 3px; }
.r2-period-existing-notice strong { color: var(--r2-text, #132445); }
.r2-period-existing-notice span { color: var(--r2-text-muted, #66758d); font-size: .85rem; }
.r2-salary-create-period button[data-salary-period-create-submit][hidden] { display: none !important; }
.r2-salary-period-history .salary-periods-table tr.is-current { background: #f4f7fc; }

/* Teacher/workload filters: three discrete states, not orange CTA buttons. */
.r2-salary-data-workspace .r2-salary-data-toolbar,
.salary-shell .r2-accrual-toolbar {
    align-items: end;
    gap: 12px;
}
.r2-salary-data-workspace .r2-salary-filter-control,
.salary-shell .r2-filter-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    padding: 3px;
    border: 1px solid var(--r2-salary-soft-border);
    border-radius: 9px;
    background: #f5f7fa;
}
.r2-salary-data-workspace .r2-salary-filter-control button,
.salary-shell .r2-filter-group .r2-filter-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #52637b;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: none;
}
.r2-salary-data-workspace .r2-salary-filter-control button.is-active,
.salary-shell .r2-filter-group .r2-filter-button.is-active {
    background: #fff;
    border-color: #bdcce3;
    box-shadow: 0 1px 3px rgba(18, 38, 70, .08);
    color: var(--r2-primary, #244d8d);
}
.r2-salary-data-workspace .r2-salary-filter-control button:hover:not(.is-active),
.salary-shell .r2-filter-group .r2-filter-button:hover:not(.is-active) {
    background: #e9eef7;
}
.r2-salary-data-workspace .r2-salary-data-toolbar > .r2-button { white-space: nowrap; }
.r2-salary-data-workspace .r2-salary-profile-list,
.r2-salary-data-workspace .r2-salary-workload-list { gap: 3px; }
.r2-salary-data-workspace .r2-salary-profile-row > summary,
.r2-salary-data-workspace .r2-salary-workload-row > summary {
    min-height: 66px;
    padding: 12px 14px;
    gap: 15px;
}
.r2-salary-data-workspace .r2-salary-profile-person,
.r2-salary-data-workspace .r2-salary-workload-person {
    min-width: 0;
}
.r2-salary-data-workspace .r2-salary-profile-readiness small[data-salary-profile-readiness-message] {
    max-width: 280px;
    overflow-wrap: anywhere;
}
.r2-salary-data-workspace .r2-salary-profile-editor,
.r2-salary-data-workspace .r2-salary-workload-editor { padding: 16px 18px 20px; }
.r2-salary-data-workspace .r2-salary-field-grid { gap: 15px 18px; }
.r2-salary-data-workspace .r2-salary-field-grid--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.r2-salary-data-workspace .r2-salary-field-grid--compact > .r2-field--wide { grid-column: auto; }

/* Tight and correctly associated checkboxes in both teacher editors. */
.r2-salary-data-workspace .r2-salary-check-grid,
.salary-shell .r2-individual-flags {
    gap: 8px 14px;
    margin-top: 12px;
    padding-top: 12px;
}
.r2-salary-data-workspace .r2-salary-check-grid label,
.salary-shell label.r2-check-row,
.r2-salary-data-workspace label.r2-toggle-line,
.r2-salary-data-workspace .r2-salary-source-list label {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    min-height: 35px;
    padding: 4px 6px;
    color: var(--r2-text, #132445);
    font-weight: 500;
    cursor: pointer;
}
.r2-salary-data-workspace .r2-salary-check-grid label > span,
.salary-shell label.r2-check-row > span {
    display: inline;
    min-width: 0;
    line-height: 1.3;
    margin: 0;
}
.r2-salary-data-workspace .r2-salary-check-grid input[type="checkbox"],
.salary-shell label.r2-check-row input[type="checkbox"],
.r2-salary-data-workspace label.r2-toggle-line input[type="checkbox"],
.r2-salary-data-workspace .r2-salary-source-list label input[type="checkbox"] {
    flex: 0 0 17px;
    width: 17px !important;
    height: 17px !important;
    min-width: 17px;
    margin: 0;
    accent-color: var(--r2-primary, #244d8d);
}

/* Single teacher: reduced empty space, remain editable and autosaved. */
.salary-shell.r2-salary-individual .r2-individual-section {
    padding-top: 17px;
    padding-bottom: 17px;
}
.salary-shell.r2-salary-individual .r2-individual-form { gap: 6px; }
.salary-shell.r2-salary-individual .r2-individual-grid {
    gap: 14px 16px;
}
.salary-shell.r2-salary-individual .r2-individual-grid label,
.salary-shell.r2-salary-individual .r2-individual-workload label { min-width: 0; }
.salary-shell.r2-salary-individual .r2-individual-actions {
    padding: 11px 15px;
    gap: 15px;
}
.salary-shell.r2-salary-individual .r2-individual-actions > div:first-child { gap: 1px; }
.salary-shell.r2-salary-individual .r2-individual-actions > div:first-child span { font-size: .75rem; }
.salary-shell.r2-salary-individual .r2-individual-actions > div:first-child strong { font-size: .86rem; }

/* Batch 5.21: individual calculation form controls.
   Match the already accepted teacher-profile fields; do not change form data
   or the autosave contract. Keep every selector inside the individual page. */
body.has-app-shell .salary-shell.r2-salary-individual .r2-individual-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px 14px;
}

body.has-app-shell .salary-shell.r2-salary-individual
:is(.r2-individual-selector, .r2-individual-grid, .r2-individual-workload, .r2-individual-new-teacher)
label {
    min-width: 0;
}
body.has-app-shell .salary-shell.r2-salary-individual .r2-individual-grid > label {
    display: grid;
    grid-template-rows: minmax(20px, auto) 42px;
    align-content: start;
    gap: 8px;
}
body.has-app-shell .salary-shell.r2-salary-individual
:is(.r2-individual-selector, .r2-individual-grid, .r2-individual-workload, .r2-individual-new-teacher)
label > :is(input:not([type="checkbox"]):not([type="radio"]), select) {
    box-sizing: border-box;
    display: block;
    width: 100%;
    min-width: 0;
    height: 42px;
    min-height: 42px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid var(--r2-border-strong, #cbd5e1);
    border-radius: var(--r2-radius-md, 9px);
    background: var(--r2-surface, #fff);
    color: var(--r2-text, #132445);
}
body.has-app-shell .salary-shell.r2-salary-individual
:is(.r2-individual-selector, .r2-individual-grid, .r2-individual-workload, .r2-individual-new-teacher)
label > :is(input:not([type="checkbox"]):not([type="radio"]), select) {
    font-family: inherit;
    font-size: var(--r2-font-size-sm, .875rem);
    font-weight: 500;
    line-height: 1.35;
}
body.has-app-shell .salary-shell.r2-salary-individual
:is(.r2-individual-selector, .r2-individual-grid, .r2-individual-workload, .r2-individual-new-teacher)
label > :is(input:not([type="checkbox"]):not([type="radio"]), select):hover:not(:disabled) {
    border-color: var(--r2-primary-border, #9db8df);
}
body.has-app-shell .salary-shell.r2-salary-individual
:is(.r2-individual-selector, .r2-individual-grid, .r2-individual-workload, .r2-individual-new-teacher)
label > :is(input:not([type="checkbox"]):not([type="radio"]), select):focus {
    outline: none;
    border-color: var(--r2-primary, #244d8d);
    box-shadow: var(--r2-focus-ring, 0 0 0 3px rgba(36,77,141,.15));
}
body.has-app-shell .salary-shell.r2-salary-individual
:is(.r2-individual-selector, .r2-individual-grid, .r2-individual-workload, .r2-individual-new-teacher)
label > :is(input:not([type="checkbox"]):not([type="radio"]), select):disabled {
    background: var(--r2-surface-muted, #f4f6f9);
    color: var(--r2-text-disabled, #77859a);
    border-color: var(--r2-border, #dbe3ee);
}
body.has-app-shell .salary-shell.r2-salary-individual
:is(.r2-individual-selector, .r2-individual-grid, .r2-individual-workload, .r2-individual-new-teacher)
input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}
body.has-app-shell .salary-shell.r2-salary-individual input[type="number"]::-webkit-inner-spin-button,
body.has-app-shell .salary-shell.r2-salary-individual input[type="number"]::-webkit-outer-spin-button {
    appearance: none;
    margin: 0;
}
/* The shared secondary-fields component pads only .r2-salary-field-grid;
   individual calculation uses .r2-individual-grid instead. */
body.has-app-shell .salary-shell.r2-salary-individual
.r2-salary-secondary-fields > .r2-individual-grid {
    padding: 14px 16px 16px;
}
body.has-app-shell .salary-shell.r2-salary-individual .r2-individual-workload {
    align-items: start;
}
body.has-app-shell .salary-shell.r2-salary-individual .r2-individual-workload > label {
    display: grid;
    grid-template-rows: minmax(20px, auto) 42px;
    align-content: start;
    gap: 8px;
}

@media (max-width: 1450px) {
    body.has-app-shell .salary-shell.r2-salary-individual .r2-individual-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 1130px) {
    body.has-app-shell .salary-shell.r2-salary-individual .r2-individual-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 760px) {
    body.has-app-shell .salary-shell.r2-salary-individual .r2-individual-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Allowances: compact accordion rows with an explicit settings toggle. */
.salary-shell .r2-accrual-teacher__body { gap: 13px; padding: 14px; }
.salary-shell .r2-allowance-family { gap: 7px; }
.salary-shell .r2-allowance-family h3 {
    margin: 8px 0 0;
    font-weight: 750;
    font-size: .81rem;
    color: #53647a;
}
.salary-shell .r2-allowance-options { border-radius: 9px; overflow: clip; }
.salary-shell .r2-allowance-option {
    gap: 0;
    padding: 0;
    border-color: #e1e6ee;
    box-shadow: none;
}
.salary-shell .r2-allowance-option.is-selected {
    box-shadow: inset 3px 0 0 var(--r2-primary, #244d8d);
    background: #f5f8fd;
}
.salary-shell .r2-allowance-option__main {
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
}
.salary-shell .salary-allowance-option-toggle {
    display: flex;
    flex: 1 1 450px;
    flex-direction: row;
    align-items: flex-start;
    min-width: 0;
    gap: 11px;
    margin: 0;
    cursor: pointer;
}
.salary-shell .salary-allowance-option-toggle input[type="checkbox"] {
    flex: 0 0 17px;
    width: 17px !important;
    height: 17px !important;
    min-width: 17px;
    margin: 2px 0 0;
    accent-color: var(--r2-primary, #244d8d);
}
.salary-shell .salary-allowance-option-toggle span { min-width: 0; gap: 2px; }
.salary-shell .salary-allowance-option-toggle strong { font-size: .9rem; line-height: 1.3; }
.salary-shell .salary-allowance-option-toggle small { font-size: .77rem; line-height: 1.4; font-weight: 400; }
.salary-shell .r2-allowance-option__controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex: 0 0 auto;
}
.salary-shell .r2-allowance-config-button {
    appearance: none;
    border: 1px solid #cad5e6;
    background: #fff;
    color: var(--r2-primary, #244d8d);
    font: inherit;
    font-size: .79rem;
    font-weight: 700;
    line-height: 1.35;
    border-radius: 6px;
    padding: 7px 10px;
    cursor: pointer;
    white-space: nowrap;
}
.salary-shell .r2-allowance-config-button:hover { background: #eef3fb; border-color: #a9bfe0; }
.salary-shell .r2-allowance-config-button:focus-visible { outline: 2px solid #254f90; outline-offset: 2px; }
.salary-shell .r2-allowance-option__config {
    padding: 14px;
    border-top: 1px solid #e0e7f1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.salary-shell .r2-allowance-option__config[hidden] { display: none !important; }
.salary-shell .r2-allowance-option__config .field { min-width: 0; }
.salary-shell .r2-allowance-note { grid-column: span 1; }
.salary-shell .r2-allowance-option__config input,
.salary-shell .r2-allowance-option__config select { width: 100%; }

/* Allowances use the same input rhythm as salary teacher profiles. */
.salary-shell .r2-accrual-page .r2-allowance-option__config :is(input, select) {
    box-sizing: border-box;
    height: 42px;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid #cbd5e3;
    border-radius: 9px;
    background: #fff;
    line-height: 1.3;
}
.salary-shell .r2-accrual-page .r2-allowance-option__config :is(input, select):focus-visible {
    border-color: #254f90;
    outline: 2px solid rgba(37, 79, 144, .2);
    outline-offset: 1px;
}
.salary-shell .r2-accrual-page .r2-allowance-option__config input[aria-invalid="true"] {
    border-color: #b42318;
}
.salary-shell .r2-accrual-page .r2-allowance-option__config input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}
.salary-shell .r2-accrual-page .r2-allowance-option__config input[type="number"]::-webkit-inner-spin-button,
.salary-shell .r2-accrual-page .r2-allowance-option__config input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

@media (max-width: 1000px) {
    .salary-shell .r2-allowance-option__config { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .r2-salary-data-workspace .r2-salary-profile-readiness small[data-salary-profile-readiness-message] { max-width: 200px; }
}
@media (max-width: 760px) {
    .r2-salary-data-workspace .r2-salary-field-grid--compact,
    .salary-shell .r2-allowance-option__config { grid-template-columns: 1fr; }
    .salary-shell .r2-allowance-option__main { flex-wrap: wrap; align-items: flex-start; }
    .salary-shell .r2-allowance-option__controls { flex: 1 1 100%; justify-content: space-between; padding-left: 27px; }
    .r2-salary-data-workspace .r2-salary-check-grid,
    .salary-shell .r2-individual-flags { grid-template-columns: 1fr; }
    .salary-shell .r2-individual-actions,
    .salary-shell .r2-salary-heading,
    .r2-salary-data-workspace .r2-salary-data-heading { align-items: stretch; }
    .r2-period-existing-notice .btn { width: 100%; text-align: center; }
}


/* Batch 5.6: resolve actual browser collisions with app_ui.css.
   app_ui.css gives every button[type=button] an orange background and every
   label an inline-block layout; regular class-only selectors cannot win. */
body.has-app-shell .r2-salary-data-workspace .r2-salary-filter-control button[type="button"],
body.has-app-shell .salary-shell .r2-filter-group button.r2-filter-button[type="button"] {
    min-height: 34px;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 6px 12px;
    background: transparent;
    color: #52637b;
    box-shadow: none;
    font-size: .84rem;
    font-weight: 650;
    line-height: 1.3;
    transform: none;
}
body.has-app-shell .r2-salary-data-workspace .r2-salary-filter-control button[type="button"].is-active,
body.has-app-shell .salary-shell .r2-filter-group button.r2-filter-button[type="button"].is-active {
    border-color: #bdcce3;
    background: #fff;
    color: var(--r2-primary, #234f93);
    box-shadow: 0 1px 3px rgba(18,38,70,.08);
}
body.has-app-shell .r2-salary-data-workspace .r2-salary-filter-control button[type="button"]:hover,
body.has-app-shell .salary-shell .r2-filter-group button.r2-filter-button[type="button"]:hover {
    transform: none;
}
body.has-app-shell .r2-salary-data-workspace .r2-salary-filter-control button[type="button"]:hover:not(.is-active),
body.has-app-shell .salary-shell .r2-filter-group button.r2-filter-button[type="button"]:hover:not(.is-active) {
    background: #e9eef7;
    color: var(--r2-text, #172543);
}

/* Neutral secondary links should not look like orange submit buttons. */
body.has-app-shell .salary-shell.r2-salary-workspace a.button-link:not(.primary):not(.danger):not(.green) {
    min-height: 36px;
    padding: 7px 12px;
    border: 1px solid #cbd5e3;
    border-radius: 7px;
    background: #fff;
    color: var(--r2-text, #172543);
    box-shadow: none;
    font-weight: 650;
    line-height: 1.3;
    transform: none;
}
body.has-app-shell .salary-shell.r2-salary-workspace a.button-link:not(.primary):not(.danger):not(.green):hover {
    border-color: #a9bfe0;
    background: var(--r2-primary-soft, #e9eff8);
    color: var(--r2-primary, #234f93);
    transform: none;
}
body.has-app-shell .salary-shell button.r2-allowance-config-button[type="button"] {
    min-height: 34px;
    border: 1px solid #cad5e6;
    border-radius: 6px;
    padding: 7px 10px;
    background: #fff;
    color: var(--r2-primary, #234f93);
    font-size: .79rem;
    font-weight: 700;
    line-height: 1.3;
    box-shadow: none;
    transform: none;
}
body.has-app-shell .salary-shell button.r2-allowance-config-button[type="button"]:hover {
    background: var(--r2-primary-soft, #e9eff8);
    border-color: #a9bfe0;
    transform: none;
}

/* Radio choices were vertically broken because legacy label display won. */
body.has-app-shell .salary-shell label.r2-salary-scheme-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    margin: 0;
    padding: 14px 16px;
    border-radius: 9px;
    color: var(--r2-text, #172543);
    font-size: .9rem;
    font-weight: 500;
    line-height: 1.4;
}
body.has-app-shell .salary-shell label.r2-salary-scheme-option > input[type="radio"] {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--r2-primary, #234f93);
}
body.has-app-shell .salary-shell label.r2-salary-scheme-option > span {
    display: grid;
    gap: 3px;
    min-width: 0;
}
body.has-app-shell .salary-shell label.r2-salary-scheme-option strong { font-size: .9rem; }
body.has-app-shell .salary-shell label.r2-salary-scheme-option small {
    color: var(--r2-text-muted, #667085);
    font-size: .79rem;
    font-weight: 400;
    line-height: 1.4;
}
body.has-app-shell .salary-shell .r2-salary-scheme-options { gap: 12px; }
body.has-app-shell .salary-shell .r2-salary-scheme-panel { padding-block: 16px; }
body.has-app-shell .salary-shell .r2-salary-scheme-panel__head { gap: 12px; }

/* The period selector is now part of the period context cell, not a fifth row. */
[data-salary-profiles-page] .r2-salary-data-context { grid-template-columns: repeat(4, minmax(0,1fr)); }
[data-salary-profiles-page] .r2-salary-data-context > .r2-salary-context-period { min-width: 0; }
[data-salary-profiles-page] .r2-salary-data-context > .r2-salary-context-period form {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}
[data-salary-profiles-page] .r2-salary-data-context .r2-salary-context-picker select {
    min-width: 0;
    width: 100%;
    min-height: 36px;
    margin-top: 1px;
    padding: 6px 10px;
    font-size: .84rem;
    font-weight: 650;
}
[data-salary-profiles-page] .r2-salary-data-context > div { min-height: 86px; padding: 12px 15px; }
[data-salary-profiles-page] .r2-salary-data-context small { line-height: 1.4; }

/* Keep long profile editors readable without five disconnected columns of flags. */
body.has-app-shell .r2-salary-data-workspace label.r2-field {
    display: grid;
    gap: 6px;
    min-width: 0;
    margin: 0;
    color: var(--r2-text, #172543);
    font-size: .82rem;
    font-weight: 650;
}
.r2-salary-data-workspace .r2-salary-check-grid,
.r2-salary-data-workspace .r2-salary-check-grid--wide {
    grid-template-columns: repeat(3, minmax(0, 240px));
    gap: 8px 20px;
}
.r2-salary-data-workspace .r2-salary-profile-editor { gap: 14px; }
.r2-salary-data-workspace .r2-salary-profile-section { padding-block: 13px; }
.r2-salary-data-workspace .r2-salary-data-toolbar { flex-wrap: wrap; }
.r2-salary-data-workspace .r2-salary-data-toolbar .r2-field--search { flex: 1 1 240px; max-width: 350px; }
.r2-salary-data-workspace .r2-salary-data-toolbar .r2-salary-filter-control { margin-left: auto; }

/* Reduce duplicate visual hierarchy on overview and period landing screens. */
.salary-shell .r2-salary-stage-section .section-title-row { margin-bottom: 10px; }
.salary-shell .r2-salary-stage a { min-height: 62px; padding-block: 8px; }
.salary-shell .r2-salary-stage__body { gap: 1px; }
.salary-shell .r2-salary-stage__body small { line-height: 1.3; }
.salary-shell .r2-salary-next-action { gap: 18px; padding: 18px 22px; }
.salary-shell .r2-salary-next-action__controls { gap: 8px; }
.r2-app .r2-salary-journey { margin-top: 16px; padding: 9px 14px; }
.r2-app .r2-salary-journey__side a { min-height: 48px; }

@media (max-width: 1100px) {
    [data-salary-profiles-page] .r2-salary-data-context { grid-template-columns: repeat(2, minmax(0,1fr)); }
    [data-salary-profiles-page] .r2-salary-data-context > :nth-child(2) { border-right: 0; }
    [data-salary-profiles-page] .r2-salary-data-context > :nth-child(-n+2) { border-bottom: 1px solid var(--r2-border); }
}
@media (max-width: 760px) {
    [data-salary-profiles-page] .r2-salary-data-context { grid-template-columns: 1fr; }
    [data-salary-profiles-page] .r2-salary-data-context > * { border-right: 0; border-bottom: 1px solid var(--r2-border); }
    [data-salary-profiles-page] .r2-salary-data-context > :last-child { border-bottom: 0; }
    .r2-salary-data-workspace .r2-salary-check-grid,
    .r2-salary-data-workspace .r2-salary-check-grid--wide { grid-template-columns: 1fr; }
    .r2-salary-data-workspace .r2-salary-data-toolbar .r2-salary-filter-control { margin-left: 0; }
    .r2-salary-data-workspace .r2-salary-data-toolbar .r2-field--search {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
    }
    .salary-shell .r2-salary-next-action { flex-direction: column; align-items: stretch; }
    .salary-shell .r2-salary-next-action__controls { justify-content: flex-start; }
}

/* Replacements: server-backed filter links stay visually identical to segmented controls. */
.r2-accrual-page .r2-replacement-filters a.r2-filter-button {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; line-height: 1.35; white-space: nowrap;
}
.r2-accrual-page .r2-replacement-filters a.r2-filter-button:focus-visible {
  outline: 2px solid var(--r2-primary, #244d88); outline-offset: 2px;
}

/* Keep filter errors local; loading does not move or refresh the page. */
.r2-accrual-page .r2-replacement-filter-error {
  margin: 8px 0 0; color: var(--r2-danger, #b42318); font-size: .875rem;
}
.r2-accrual-page .r2-replacement-filter-error[hidden],
.r2-accrual-page [data-replacement-search-empty][hidden] { display: none; }

/* Batch 5.22: place the optional teacher-creation disclosure BELOW the
   period/teacher selectors. Keep their two-column alignment in both states. */
body.has-app-shell .salary-shell.r2-salary-individual .r2-individual-selector {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 10px;
}
body.has-app-shell .salary-shell.r2-salary-individual .r2-individual-selector__form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
body.has-app-shell .salary-shell.r2-salary-individual .r2-individual-new-teacher {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    margin: 0;
}
body.has-app-shell .salary-shell.r2-salary-individual .r2-individual-new-teacher > summary {
    display: list-item;
    width: fit-content;
    padding: 4px 0;
    font-size: .9rem;
    line-height: 1.4;
    font-weight: 650;
}
body.has-app-shell .salary-shell.r2-salary-individual .r2-individual-new-teacher[open] {
    padding-top: 0;
}
body.has-app-shell .salary-shell.r2-salary-individual .r2-individual-new-teacher > form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 12px 14px;
    margin-top: 10px;
}
body.has-app-shell .salary-shell.r2-salary-individual .r2-individual-new-teacher > form > button {
    grid-column: 2;
    justify-self: end;
}
@media (max-width: 760px) {
    body.has-app-shell .salary-shell.r2-salary-individual .r2-individual-selector__form,
    body.has-app-shell .salary-shell.r2-salary-individual .r2-individual-new-teacher > form {
        grid-template-columns: minmax(0, 1fr);
    }
    body.has-app-shell .salary-shell.r2-salary-individual .r2-individual-new-teacher > form > button {
        grid-column: 1;
    }
}
