:root {
    --ecohelp-font-family: Inter, Arial, sans-serif;
    --ecohelp-font-size: 0.875rem;
    --ecohelp-font-normal: 400;
    --ecohelp-font-bold: 600;
    --ecohelp-line-height: 1.4;
    --ecohelp-control-height: 2.5rem;
    --ecohelp-control-radius: 0.375rem;
    --ecohelp-border: #94a3b8;
    --ecohelp-border-strong: #64748b;
    --ecohelp-control-background: #ffffff;
    --ecohelp-focus: #2563eb;
    --font-sans: var(--ecohelp-font-family);
    --font-weight-normal: var(--ecohelp-font-normal);
    --font-weight-medium: var(--ecohelp-font-bold);
    --font-weight-semibold: var(--ecohelp-font-bold);
    --font-weight-bold: var(--ecohelp-font-bold);
    --font-weight-extrabold: var(--ecohelp-font-bold);
}

#registration-decision-dialog {
    width: min(42rem, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    margin: auto;
    overflow: auto;
}

#registration-decision-dialog::backdrop {
    background: rgb(15 23 42 / 45%);
}

.dark {
    --ecohelp-border: #64748b;
    --ecohelp-border-strong: #94a3b8;
    --ecohelp-control-background: #0f172a;
    --ecohelp-focus: #60a5fa;
}

body {
    font-family: var(--ecohelp-font-family);
    font-size: var(--ecohelp-font-size);
    font-weight: var(--ecohelp-font-normal);
    line-height: var(--ecohelp-line-height);
}

body :is(h1, h2, h3, h4, h5, h6, th, strong, b, label) {
    font-weight: var(--ecohelp-font-bold);
}

body :is(input, select, textarea, button) {
    font-family: var(--ecohelp-font-family);
    font-size: var(--ecohelp-font-size);
    line-height: var(--ecohelp-line-height);
}

body :is(input, select, textarea) {
    font-weight: var(--ecohelp-font-normal);
}

body :is(input:not([type]), input[type="text"], input[type="email"],
input[type="password"], input[type="url"], input[type="tel"],
input[type="search"], input[type="number"], input[type="date"],
input[type="time"], input[type="datetime-local"], select:not([multiple])):where(:not(.pod9-sheet *)) {
    box-sizing: border-box;
    height: var(--ecohelp-control-height);
    min-height: var(--ecohelp-control-height);
    border: 1px solid var(--ecohelp-border);
    border-radius: var(--ecohelp-control-radius);
    background-color: var(--ecohelp-control-background);
    color: inherit;
    padding: 0.5rem 0.75rem;
}

body :is(select[multiple], textarea) {
    border: 1px solid var(--ecohelp-border);
    border-radius: var(--ecohelp-control-radius);
    background-color: var(--ecohelp-control-background);
    color: inherit;
    padding: 0.5rem 0.75rem;
}

body :is(button[type="submit"]:where(:not(#searchbar-submit)), input[type="submit"], .eco-button,
.object-tools a, .submit-row a, .account-content button:not(.password-toggle),
.error-action) {
    align-items: center;
    box-sizing: border-box;
    justify-content: center;
    min-height: var(--ecohelp-control-height);
    border-width: 1px;
    border-style: solid;
    border-radius: var(--ecohelp-control-radius);
    font-weight: var(--ecohelp-font-bold);
    padding: 0.5rem 1rem;
}

body :is(input, select, textarea, button, .eco-button):focus-visible {
    outline: 2px solid var(--ecohelp-focus);
    outline-offset: 2px;
}

body :is(input, select, textarea, button):disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.eco-button {
    border-color: var(--ecohelp-border);
    cursor: pointer;
    display: inline-flex;
    text-align: center;
}

.eco-button--danger {
    border-color: #dc2626;
    color: #b91c1c;
}

.dark .eco-button--danger {
    border-color: #f87171;
    color: #fca5a5;
}

body select:not([multiple]):where(:not(.pod9-sheet *)) {
    padding-right: 2.5rem;
}

#changelist-search > div,
div:has(> #nav-filter) {
    border-color: var(--ecohelp-border);
    border-radius: var(--ecohelp-control-radius);
}

body :is(#searchbar, #nav-filter) {
    background: transparent;
    border: 0;
}

body #searchbar-submit {
    border: 0;
    min-height: var(--ecohelp-control-height);
    padding: 0;
}

body .select2.select2-container {
    border-color: var(--ecohelp-border);
    border-radius: var(--ecohelp-control-radius);
    min-height: var(--ecohelp-control-height) !important;
}

body .select2-container--admin-autocomplete .select2-selection--single :is(
.select2-selection__rendered, .select2-selection__arrow, .select2-selection__clear) {
    height: calc(var(--ecohelp-control-height) - 2px);
    font-weight: var(--ecohelp-font-normal);
}

body .select2-container .select2-search--inline .select2-search__field {
    background: transparent;
    border: 0;
    height: auto;
    min-height: 0;
    padding: 0;
}

body .select2-container--admin-autocomplete .select2-search--dropdown .select2-search__field {
    padding-left: 2.25rem;
}

body :is(.errors input, .errors select, .errors textarea,
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"]) {
    border-color: #dc2626;
}

.eco-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-width: 0;
}

.eco-form-field :is(input:not([type="checkbox"]):not([type="radio"]), select) {
    width: 100%;
}

.eco-invite-form {
    align-items: start;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(0, 1fr);
    max-width: 64rem;
}

.eco-invite-form > .errorlist {
    grid-column: 1 / -1;
}

.eco-invite-submit {
    grid-column: 1 / -1;
    justify-self: start;
}

.eco-membership-actions {
    display: grid;
    gap: 0.75rem;
    max-width: 48rem;
}

.eco-membership-controls {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.eco-membership-controls select {
    min-width: 13rem;
}

.eco-subdivision-field {
    border: 0;
    grid-column: 1 / -1;
    margin: 0;
    min-width: 0;
    padding: 0;
}

[data-role-subdivisions][hidden] {
    display: none;
}

.eco-subdivision-field summary {
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.eco-subdivision-list {
    border: 1px solid var(--ecohelp-border);
    border-radius: var(--ecohelp-control-radius);
    max-height: 16rem;
    overflow-y: auto;
    padding: 0.5rem 0.75rem;
}

body .eco-subdivision-list label {
    align-items: flex-start;
    display: flex;
    font-weight: var(--ecohelp-font-normal);
    gap: 0.625rem;
    padding: 0.375rem 0;
}

body .eco-subdivision-list input[type="checkbox"] {
    flex: 0 0 1rem;
    height: 1rem;
    margin-top: 0.125rem;
    min-height: 0;
    padding: 0;
    width: 1rem;
}

.eco-context-form {
    align-items: center;
    display: flex;
    flex: 0 1 auto;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.75rem;
    max-width: 52rem;
    min-width: 0;
}

body .eco-context-field {
    display: flex;
    flex: 0 1 auto;
    font-weight: var(--ecohelp-font-normal);
    gap: 0.25rem;
    max-width: 100%;
    min-width: 0;
}

.eco-context-subject,
.eco-context-subdivision {
    max-width: 100%;
    min-width: 0;
    width: 100%;
}

.eco-context-name {
    max-width: 36rem;
    overflow-wrap: anywhere;
    padding: 0.5rem 0;
}

.eco-users-table {
    border-collapse: collapse;
    width: 100%;
}

.eco-users-table th {
    border-bottom: 1px solid var(--ecohelp-border-strong);
}

.eco-users-table :is(th, td) {
    padding: 0.75rem;
    text-align: left;
    vertical-align: middle;
}

.eco-users-table td:first-child {
    overflow-wrap: anywhere;
}

.eco-users-section {
    border: 1px solid var(--ecohelp-border);
    border-radius: var(--ecohelp-control-radius);
}

@media (min-width: 48rem) {
    .eco-invite-form {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    }
}
