@font-face {
    font-family: "Stack Sans Text";
    src: url("../brand/fonts/stack-sans-text-latin.woff2") format("woff2");
    font-display: swap;
    font-style: normal;
    font-weight: 100 900;
}

@font-face {
    font-family: "Stack Sans Notch";
    src: url("../brand/fonts/stack-sans-notch-latin.woff2") format("woff2");
    font-display: swap;
    font-style: normal;
    font-weight: 100 900;
}

:root,
html[data-theme="light"] {
    --fw-background: #fafaf9;
    --fw-foreground: #0b0a09;
    --fw-card: #ffffff;
    --fw-card-foreground: #0b0a09;
    --fw-muted: #f5f5f4;
    --fw-muted-strong: #e7e5e4;
    --fw-sidebar: #f5f5f4;
    --fw-muted-foreground: #6f6760;
    --fw-border: #e7e5e4;
    --fw-input: #d6d3d1;
    --fw-primary: #0b0a09;
    --fw-primary-foreground: #fafaf9;
    --fw-orange: #ff6f20;
    --fw-yellow: #fff146;
    --fw-ring: #ff6f20;
    --fw-danger: #dc2626;
    --fw-success: #166534;
    --fw-shadow: 0 1px 2px rgba(11, 10, 9, 0.05);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --fw-background: #0b0a09;
        --fw-foreground: #fafaf9;
        --fw-card: #1b1917;
        --fw-card-foreground: #fafaf9;
        --fw-muted: #292524;
        --fw-muted-strong: #35302d;
        --fw-sidebar: #141210;
        --fw-muted-foreground: #aaa39c;
        --fw-border: #2b2524;
        --fw-input: #46403b;
        --fw-primary: #fafaf9;
        --fw-primary-foreground: #0b0a09;
        --fw-orange: #fff146;
        --fw-yellow: #fff146;
        --fw-ring: #fff146;
        --fw-danger: #f87171;
        --fw-success: #86efac;
        --fw-shadow: 0 1px 2px rgba(0, 0, 0, 0.32);
        color-scheme: dark;
    }
}

html[data-theme="dark"] {
    --fw-background: #0b0a09;
    --fw-foreground: #fafaf9;
    --fw-card: #1b1917;
    --fw-card-foreground: #fafaf9;
    --fw-muted: #292524;
    --fw-muted-strong: #35302d;
    --fw-sidebar: #141210;
    --fw-muted-foreground: #aaa39c;
    --fw-border: #2b2524;
    --fw-input: #46403b;
    --fw-primary: #fafaf9;
    --fw-primary-foreground: #0b0a09;
    --fw-orange: #fff146;
    --fw-yellow: #fff146;
    --fw-ring: #fff146;
    --fw-danger: #f87171;
    --fw-success: #86efac;
    --fw-shadow: 0 1px 2px rgba(0, 0, 0, 0.32);
    color-scheme: dark;
}

:root,
html[data-theme="light"],
html[data-theme="dark"] {
    --primary: var(--fw-primary);
    --secondary: var(--fw-foreground);
    --accent: var(--fw-orange);
    --primary-fg: var(--fw-primary-foreground);
    --body-fg: var(--fw-foreground);
    --body-bg: var(--fw-background);
    --body-quiet-color: var(--fw-muted-foreground);
    --body-medium-color: var(--fw-muted-foreground);
    --body-loud-color: var(--fw-foreground);
    --header-color: var(--fw-muted-foreground);
    --header-branding-color: var(--fw-foreground);
    --header-bg: var(--fw-card);
    --header-link-color: var(--fw-foreground);
    --breadcrumbs-fg: var(--fw-muted-foreground);
    --breadcrumbs-link-fg: var(--fw-foreground);
    --breadcrumbs-bg: var(--fw-muted);
    --link-fg: var(--fw-foreground);
    --link-hover-color: var(--fw-orange);
    --link-selected-fg: var(--fw-orange);
    --hairline-color: var(--fw-border);
    --border-color: var(--fw-border);
    --error-fg: var(--fw-danger);
    --message-debug-bg: var(--fw-muted);
    --message-info-bg: var(--fw-muted);
    --message-success-bg: color-mix(in srgb, var(--fw-success) 12%, var(--fw-card));
    --message-warning-bg: color-mix(in srgb, var(--fw-yellow) 20%, var(--fw-card));
    --message-error-bg: color-mix(in srgb, var(--fw-danger) 12%, var(--fw-card));
    --darkened-bg: var(--fw-muted);
    --selected-bg: var(--fw-muted);
    --selected-row: color-mix(in srgb, var(--fw-orange) 8%, var(--fw-card));
    --button-fg: var(--fw-primary-foreground);
    --button-bg: var(--fw-primary);
    --button-hover-bg: var(--fw-orange);
    --default-button-bg: var(--fw-primary);
    --default-button-hover-bg: var(--fw-orange);
    --close-button-bg: var(--fw-muted-foreground);
    --close-button-hover-bg: var(--fw-foreground);
    --delete-button-bg: var(--fw-danger);
    --delete-button-hover-bg: color-mix(in srgb, var(--fw-danger) 82%, black);
    --object-tools-fg: var(--fw-primary-foreground);
    --object-tools-bg: var(--fw-primary);
    --object-tools-hover-bg: var(--fw-orange);
}

html,
body,
button,
input,
select,
textarea {
    font-family: "Stack Sans Text", system-ui, -apple-system, sans-serif;
}

body {
    background: var(--fw-background);
    color: var(--fw-foreground);
    font-feature-settings: "ss01" 1, "cv02" 1;
}

::selection {
    background: var(--fw-muted-strong);
    color: var(--fw-foreground);
}

h1 {
    font-family: "Stack Sans Notch", "Stack Sans Text", sans-serif;
    font-size: clamp(1.375rem, 2vw, 1.5rem);
    font-weight: 400;
    letter-spacing: -0.035em;
    line-height: 1.05;
}

h2,
h3,
h4,
h5 {
    letter-spacing: -0.015em;
}

a:link,
a:visited {
    text-underline-offset: 0.15em;
    transition: color 140ms ease;
}

a:hover,
a:focus {
    color: var(--fw-orange);
}

#header {
    border-top: 4px solid var(--fw-orange);
    border-bottom: 1px solid var(--fw-border);
    box-shadow: var(--fw-shadow);
}

.framework-admin-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
}

.framework-admin-logo {
    display: block;
    width: clamp(8.5rem, 15vw, 10.5rem);
    height: auto;
}

.framework-admin-logo-dark {
    display: none;
}

.framework-admin-label {
    padding-left: 0.9rem;
    border-left: 1px solid var(--fw-border);
    color: var(--fw-muted-foreground);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

@media (prefers-color-scheme: dark) {
    html[data-theme="auto"] .framework-admin-logo-light {
        display: none;
    }

    html[data-theme="auto"] .framework-admin-logo-dark {
        display: block;
    }
}

html[data-theme="dark"] .framework-admin-logo-light {
    display: none;
}

html[data-theme="dark"] .framework-admin-logo-dark {
    display: block;
}

html[data-theme="light"] .framework-admin-logo-light {
    display: block;
}

html[data-theme="light"] .framework-admin-logo-dark {
    display: none;
}

#user-tools {
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

#user-tools a:hover,
#logout-form button:hover {
    color: var(--fw-orange);
}

.theme-toggle {
    border-radius: 4px;
}

div.breadcrumbs {
    border-bottom: 1px solid var(--fw-border);
    font-size: 0.75rem;
}

.main > #nav-sidebar {
    border-right-color: var(--fw-border);
    background: var(--fw-muted);
}

.toggle-nav-sidebar {
    border-right-color: var(--fw-border);
    background: var(--fw-muted);
    color: var(--fw-muted-foreground);
}

.toggle-nav-sidebar:hover,
.toggle-nav-sidebar:focus {
    background: var(--fw-muted-strong);
    color: var(--fw-orange);
}

#nav-filter {
    border-color: var(--fw-input);
    border-radius: 4px;
    background: var(--fw-card);
    color: var(--fw-foreground);
}

#nav-sidebar .module th,
#nav-sidebar .module td {
    border-bottom-color: var(--fw-border);
}

#nav-sidebar .current-model {
    border-left: 2px solid var(--fw-orange);
    background: transparent;
}

#nav-sidebar a:hover,
#nav-sidebar a:focus {
    color: var(--fw-orange);
}

.module,
.inline-group,
.submit-row,
#changelist-filter {
    border: 1px solid var(--fw-border);
    border-radius: 6px;
    background: var(--fw-card);
    box-shadow: var(--fw-shadow);
    overflow: hidden;
}

.module h2,
.module caption,
.inline-group h2,
fieldset.collapse summary {
    border-bottom: 1px solid var(--fw-border);
    background: var(--fw-muted);
    color: var(--fw-card-foreground);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.form-row,
.inline-related,
fieldset,
.results table,
#changelist-filter li {
    border-color: var(--fw-border);
}

input,
textarea,
select,
.vTextField {
    border-color: var(--fw-input);
    border-radius: 4px;
    background: var(--fw-card);
    color: var(--fw-foreground);
    box-shadow: none;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

input:focus,
textarea:focus,
select:focus,
.vTextField:focus {
    border-color: var(--fw-ring);
    outline: 0;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--fw-ring) 20%, transparent);
}

input[disabled],
textarea[disabled],
select[disabled],
.readonly {
    color: var(--fw-muted-foreground);
}

.button,
input[type="submit"],
input[type="button"],
.submit-row input,
a.button {
    border: 1px solid transparent;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.button:focus,
input[type="submit"]:focus,
input[type="button"]:focus,
.submit-row input:focus,
a.button:focus {
    outline: 3px solid color-mix(in srgb, var(--fw-ring) 30%, transparent);
    outline-offset: 2px;
}

.button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.submit-row input:hover,
a.button:hover,
.object-tools a:hover,
.object-tools a:focus {
    color: #0b0a09;
}

.object-tools a:link,
.object-tools a:visited {
    border-radius: 4px;
    font-weight: 600;
}

table thead th,
table thead td,
.results thead th {
    border-color: var(--fw-border);
    background: var(--fw-muted);
    color: var(--fw-muted-foreground);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.065em;
    text-transform: uppercase;
}

table tbody tr {
    transition: background-color 120ms ease;
}

table tbody tr:hover {
    background: color-mix(in srgb, var(--fw-orange) 5%, var(--fw-card));
}

.row1,
.row2 {
    background: var(--fw-card);
}

.paginator,
.changelist-footer {
    border-color: var(--fw-border);
    background: var(--fw-card);
}

#changelist-filter h2 {
    border-bottom-color: var(--fw-border);
}

#changelist-filter h3 {
    color: var(--fw-muted-foreground);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.065em;
    text-transform: uppercase;
}

#changelist-filter li.selected {
    border-left-color: var(--fw-orange);
}

ul.messagelist li {
    border: 1px solid var(--fw-border);
    border-left: 3px solid var(--fw-orange);
    border-radius: 4px;
    color: var(--fw-foreground);
    box-shadow: var(--fw-shadow);
}

ul.messagelist li.success {
    border-left-color: var(--fw-success);
}

ul.messagelist li.error {
    border-left-color: var(--fw-danger);
}

.errornote,
ul.errorlist {
    border-radius: 4px;
}

.selector {
    border-color: var(--fw-border);
}

.selector-available,
.selector-chosen {
    border-color: var(--fw-border);
    border-radius: 6px;
    overflow: hidden;
}

.selector-available-title,
.selector-chosen-title {
    background: var(--fw-muted);
    color: var(--fw-foreground);
}

.help,
p.help,
form p.help,
div.help,
form div.help,
div.help li {
    color: var(--fw-muted-foreground);
}

#content-related {
    border-left-color: var(--fw-border);
    background: var(--fw-muted);
}

#content-related .module {
    border: 0;
    box-shadow: none;
}

body.login {
    position: relative;
    background-color: var(--fw-background);
}

body.login::before {
    position: fixed;
    z-index: 0;
    background: var(--fw-foreground);
    content: "";
    inset: 0;
    -webkit-mask-image: url("../brand/patterns/diagonal.svg");
    -webkit-mask-position: center;
    -webkit-mask-repeat: repeat;
    -webkit-mask-size: 8px 8px;
    mask-image: url("../brand/patterns/diagonal.svg");
    mask-position: center;
    mask-repeat: repeat;
    mask-size: 8px 8px;
    opacity: 0.08;
    pointer-events: none;
}

body.login #container {
    position: relative;
    z-index: 1;
    border: 1px solid var(--fw-border);
    border-radius: 8px;
    background: var(--fw-card);
    box-shadow: 0 20px 55px rgba(11, 10, 9, 0.12);
    overflow: hidden;
}

body.login #header {
    border-top: 4px solid var(--fw-orange);
    border-bottom: 1px solid var(--fw-border);
    background: var(--fw-card);
}

body.login #content {
    padding-top: 2rem;
}

body.login .form-row label {
    color: var(--fw-foreground);
    font-weight: 600;
}

body.login .submit-row {
    padding-top: 0.75rem;
}

@media (max-width: 767px) {
    .framework-admin-logo {
        width: 8.5rem;
    }

    .framework-admin-label {
        display: none;
    }
}

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

/* Final changelist overrides must follow Django's responsive changelist rules. */
.change-list #changelist .changelist-form-container,
.change-list #changelist .changelist-form-container:has(#changelist-filter),
.change-list #changelist .changelist-form-container:has(#changelist-filter) > .framework-changelist-main {
    display: block;
    width: 100%;
    max-width: none;
    min-width: 0;
}

.change-list #changelist-filter {
    width: 100%;
    flex-basis: auto;
    margin: 0 0 0.5rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: transparent;
}

.change-list #changelist-filter details > summary {
    padding: 0;
}

.change-list #changelist-filter details > summary::before {
    display: none;
    content: none;
}

.change-list #changelist-filter details summary > .framework-filter-label {
    display: block;
}

.change-list #changelist-filter details summary > .framework-filter-trigger {
    display: flex;
}

.change-list #changelist-filter .framework-filter > ul {
    position: absolute;
    z-index: 20;
    top: calc(100% + 0.25rem);
    left: 0;
    width: max-content;
    min-width: 100%;
    max-width: min(22rem, calc(100vw - 2rem));
    max-height: 18rem;
    overflow-y: auto;
    margin: 0;
    padding: 0.25rem;
    border: 1px solid var(--fw-border);
    border-radius: 6px;
    background: var(--fw-card);
    box-shadow: 0 4px 12px rgba(11, 10, 9, 0.12);
}

.change-list #changelist-filter .framework-filter li,
.change-list #changelist-filter .framework-filter li.selected {
    margin: 0;
    padding: 0;
    border: 0;
}

.change-list #changelist-filter .framework-filter li a {
    display: flex;
    min-height: 2rem;
    box-sizing: border-box;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
}

.framework-filter-value > span + span::before {
    content: ", ";
}

.change-list #changelist .actions {
    margin: 0 0 0.5rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.change-list #changelist .actions select {
    margin: 0;
}

.framework-action-field {
    position: relative;
    display: inline-flex;
    min-width: 12.5rem;
}

.framework-action-dropdown {
    width: 12.5rem;
}

.framework-action-select {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.framework-action-dropdown button {
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
}

.change-list #changelist-form .results {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--fw-border);
    border-radius: 4px 4px 0 0;
    background: var(--fw-card);
}

.change-list #changelist-form .results table {
    border: 0;
    background: var(--fw-card);
}

.change-list #changelist-form .results thead th,
.change-list #changelist-form .results thead td {
    background: transparent;
}

.change-list #changelist-form .changelist-footer {
    width: 100%;
    margin: 0;
    padding: 0 1rem;
    border: 1px solid var(--fw-border);
    border-top: 0;
    border-radius: 0 0 4px 4px;
    background: var(--fw-card);
}

.change-list #changelist-form .paginator {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.framework-page-heading {
    margin: 0 0 1rem;
}

.framework-page-heading h1 {
    margin: 0;
}

.framework-page-back,
.framework-page-back:link,
.framework-page-back:visited {
    display: inline-flex;
    min-height: 2rem;
    align-items: center;
    gap: 0.375rem;
    margin: 0 0 0.5rem;
    color: var(--fw-muted-foreground);
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.25rem;
    text-decoration: none;
}

.framework-page-back-icon {
    display: block;
    width: 1rem;
    height: 1rem;
    flex: 0 0 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.framework-page-back:hover,
.framework-page-back:focus-visible {
    color: var(--fw-foreground);
    text-decoration: none;
}

.framework-page-back:focus-visible {
    border-radius: 3px;
    outline: 2px solid var(--fw-ring);
    outline-offset: 2px;
}

/* Shadcn-style changelist controls and data table. */
.change-list #changelist,
.change-list #changelist.filtered,
.change-list #changelist .changelist-form-container,
.change-list #changelist .framework-changelist-main {
    display: block;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
}

.change-list #toolbar {
    margin-bottom: 1rem;
}

.change-list #changelist-filter {
    display: flex;
    width: 100%;
    align-items: flex-end;
    gap: 0.75rem;
    margin: 0 0 0.5rem;
    padding: 0;
    border: 0;
    background: transparent;
}

.framework-filter-fields {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
}

.framework-filter {
    position: relative;
    width: 12.5rem;
    min-width: 0;
    margin: 0;
}

.framework-filter > summary {
    display: flex;
    cursor: pointer;
    list-style: none;
    flex-direction: column;
    gap: 0.375rem;
    outline: none;
}

.framework-filter > summary::-webkit-details-marker {
    display: none;
}

.framework-filter-label {
    overflow: hidden;
    color: var(--fw-foreground);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.framework-filter-trigger {
    display: flex;
    height: 2rem;
    box-sizing: border-box;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0 0.75rem;
    border: 1px solid var(--fw-border);
    border-radius: 4px;
    background: var(--fw-card);
    color: var(--fw-muted-foreground);
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1;
}

.framework-filter-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.framework-filter-chevron {
    width: 0.375rem;
    height: 0.375rem;
    flex: 0 0 auto;
    margin-top: -0.1875rem;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: rotate(45deg);
}

.framework-filter[open] .framework-filter-trigger,
.framework-filter > summary:focus-visible .framework-filter-trigger {
    border-color: var(--fw-ring);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--fw-ring) 18%, transparent);
}

.framework-filter[open] .framework-filter-chevron {
    margin-top: 0.1875rem;
    transform: rotate(225deg);
}

.framework-filter > ul {
    position: absolute;
    z-index: 20;
    top: calc(100% + 0.25rem);
    left: 0;
    width: max-content;
    min-width: 100%;
    max-width: min(22rem, calc(100vw - 2rem));
    max-height: 18rem;
    box-sizing: border-box;
    overflow-y: auto;
    margin: 0;
    padding: 0.25rem;
    border: 1px solid var(--fw-border);
    border-radius: 6px;
    background: var(--fw-card);
    box-shadow: 0 4px 12px rgba(11, 10, 9, 0.12);
}

.framework-filter li,
.framework-filter li.selected {
    margin: 0;
    padding: 0;
    border: 0;
    list-style: none;
}

.framework-filter li a,
.framework-filter li a:link,
.framework-filter li a:visited {
    display: flex;
    min-height: 2rem;
    box-sizing: border-box;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    border-radius: 4px;
    color: var(--fw-foreground);
    font-size: 0.875rem;
    line-height: 1.25rem;
    text-decoration: none;
}

.framework-filter li a:hover,
.framework-filter li a:focus-visible {
    background: var(--fw-muted);
    color: var(--fw-orange);
    outline: none;
}

.framework-filter-check {
    width: 0.75rem;
    height: 0.375rem;
    flex: 0 0 auto;
    border-bottom: 1.5px solid currentColor;
    border-left: 1.5px solid currentColor;
    opacity: 0;
    transform: rotate(-45deg) translateY(-0.125rem);
}

.framework-filter li.selected .framework-filter-check {
    opacity: 1;
}

.framework-clear-filters {
    min-height: 2rem;
    display: inline-flex;
    align-items: center;
    color: var(--fw-muted-foreground) !important;
    font-size: 0.8125rem;
    white-space: nowrap;
}

.framework-clear-filters:hover {
    color: var(--fw-orange) !important;
}

.change-list #changelist-form {
    display: flex;
    min-width: 0;
    flex-direction: column;
    margin: 0;
}

.change-list #changelist .actions {
    display: flex;
    min-height: 2rem;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.5rem;
    padding: 0;
    border: 0;
    background: transparent;
}

.change-list #changelist .actions label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.change-list #changelist .actions select {
    margin: 0;
}

.change-list #changelist-form .results {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: auto;
    border: 1px solid var(--fw-border);
    border-radius: 4px 4px 0 0;
    background: var(--fw-card);
}

.change-list #changelist-form .results table {
    width: 100%;
    min-width: 45rem;
    margin: 0;
    border: 0;
    border-collapse: collapse;
    background: var(--fw-card);
    color: var(--fw-foreground);
    font-size: 0.875rem;
}

.change-list #changelist-form .results thead {
    background: color-mix(in srgb, var(--fw-muted) 60%, transparent);
}

.change-list #changelist-form .results thead th,
.change-list #changelist-form .results thead td {
    height: 2.75rem;
    box-sizing: border-box;
    padding: 0 1rem;
    border-bottom: 1px solid var(--fw-border);
    background: transparent;
    color: var(--fw-muted-foreground);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    line-height: 1rem;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.change-list #changelist-form .results thead th a,
.change-list #changelist-form .results thead th a:link,
.change-list #changelist-form .results thead th a:visited {
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-decoration: none;
    text-transform: inherit;
}

.change-list #changelist-form .results tbody tr,
.change-list #changelist-form .results tbody tr:nth-child(odd),
.change-list #changelist-form .results tbody tr:nth-child(even) {
    border-bottom: 1px solid var(--fw-border);
    background: transparent;
}

.change-list #changelist-form .results tbody tr:last-child {
    border-bottom: 0;
}

.change-list #changelist-form .results tbody tr:hover {
    background: color-mix(in srgb, var(--fw-muted) 35%, transparent);
}

.change-list #changelist-form .results tbody tr.selected,
.change-list #changelist-form .results tbody tr:has(.action-select:checked) {
    background: var(--fw-muted);
}

.change-list #changelist-form .results tbody th,
.change-list #changelist-form .results tbody td {
    height: 3rem;
    max-width: 24rem;
    box-sizing: border-box;
    overflow: hidden;
    padding: 0.75rem 1rem;
    border: 0;
    color: var(--fw-foreground);
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.25rem;
    text-align: left;
    text-overflow: ellipsis;
    vertical-align: middle;
    white-space: nowrap;
}

.change-list #changelist-form .results tbody th a,
.change-list #changelist-form .results tbody td a {
    color: var(--fw-foreground);
    font-weight: 500;
    text-decoration: none;
}

.change-list #changelist-form .results tbody th a:hover,
.change-list #changelist-form .results tbody td a:hover {
    color: var(--fw-orange);
}

.change-list #changelist-form .results .action-checkbox-column,
.change-list #changelist-form .results .action-checkbox {
    width: 2.75rem;
    box-sizing: border-box;
    padding-right: 0;
}

.change-list #changelist-form .results input[type="checkbox"] {
    width: 0.875rem;
    height: 0.875rem;
    margin: 0;
    accent-color: var(--fw-primary);
}

.change-list #changelist-form .changelist-footer {
    min-height: 2.75rem;
    display: flex;
    box-sizing: border-box;
    align-items: center;
    margin: 0;
    padding: 0 1rem;
    border: 1px solid var(--fw-border);
    border-top: 0;
    border-radius: 0 0 4px 4px;
    background: var(--fw-card);
}

.change-list #changelist-form .paginator {
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--fw-muted-foreground);
    font-size: 0.875rem;
}

@media (max-width: 767px) {
    .change-list #changelist-filter {
        align-items: stretch;
        flex-direction: column;
    }

    .framework-filter-fields {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .framework-filter {
        width: 100%;
    }

    .framework-filter > ul {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .framework-filter-fields {
        grid-template-columns: 1fr;
    }
}

/* Shadcn-style application shell, aligned with smart-frontend. */
:root {
    --fw-sidebar-width: 16rem;
    --fw-topbar-height: 3rem;
    --fw-control-height: 2.25rem;
    --fw-radius: 4px;
}

body:not(.login):not(.popup) {
    min-width: 0;
    height: 100svh;
    background: var(--fw-sidebar);
    font-size: 0.875rem;
    overflow: hidden;
}

body:not(.login):not(.popup) #container {
    position: relative;
    min-width: 0;
    min-height: 100svh;
    height: 100svh;
    isolation: isolate;
    overflow: hidden;
}

body:not(.login):not(.popup) #header {
    position: sticky;
    z-index: 25;
    top: 0.5rem;
    min-height: var(--fw-topbar-height);
    box-sizing: border-box;
    justify-content: space-between;
    margin: 0.5rem 0.5rem 0 0.5rem;
    padding: 0 0.75rem 0 4rem;
    border: 1px solid var(--fw-border);
    border-radius: 0.375rem 0.375rem 0 0;
    background: color-mix(in srgb, var(--fw-background) 92%, transparent);
    box-shadow: none;
    backdrop-filter: blur(10px);
    transition: none;
}

body:not(.login):not(.popup) #header #branding {
    display: flex;
    min-width: 0;
    align-items: center;
    color: var(--fw-foreground);
}

.framework-header-context {
    overflow: hidden;
    color: var(--fw-foreground);
    font-size: 0.875rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body:not(.login):not(.popup) #header #branding::before {
    position: absolute;
    top: 0.75rem;
    bottom: 0.75rem;
    left: 3rem;
    width: 1px;
    content: "";
    background: var(--fw-border);
}

body:not(.login):not(.popup) #header #user-tools {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    margin: 0;
    color: var(--fw-foreground);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.framework-account-menu {
    position: relative;
}

.framework-account-menu > summary {
    display: flex;
    width: 2rem;
    height: 2rem;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    border: 1px solid color-mix(in srgb, var(--fw-primary) 82%, var(--fw-background));
    border-radius: 999px;
    background: var(--fw-primary);
    color: var(--fw-primary-foreground);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    list-style: none;
    text-transform: uppercase;
}

.framework-account-menu > summary::-webkit-details-marker {
    display: none;
}

.framework-account-menu > summary:hover,
.framework-account-menu > summary:focus-visible {
    outline: 2px solid var(--fw-ring);
    outline-offset: 2px;
}

.framework-account-popover {
    position: absolute;
    z-index: 100;
    top: calc(100% + 0.375rem);
    right: 0;
    display: grid;
    width: 15rem;
    box-sizing: border-box;
    gap: 0.125rem;
    padding: 0.375rem;
    border: 1px solid var(--fw-border);
    border-radius: 0.375rem;
    background: var(--fw-background);
    box-shadow: var(--fw-shadow);
    text-align: left;
}

.framework-account-popover > strong,
.framework-account-popover > small {
    padding: 0.125rem 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.framework-account-popover > strong {
    color: var(--fw-foreground);
    font-size: 0.8125rem;
}

.framework-account-popover > small {
    margin-bottom: 0.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--fw-border);
    color: var(--fw-muted-foreground);
    font-size: 0.75rem;
}

body:not(.login):not(.popup) #header .framework-account-popover > a,
body:not(.login):not(.popup) #header .framework-account-popover > form button {
    display: flex;
    width: 100%;
    min-height: 2rem;
    box-sizing: border-box;
    align-items: center;
    padding: 0.375rem 0.5rem;
    border: 0;
    border-radius: var(--fw-radius);
    background: transparent;
    color: var(--fw-foreground);
    cursor: pointer;
    font: inherit;
    font-size: 0.8125rem;
    text-align: left;
}

body:not(.login):not(.popup) #header .framework-account-popover > a:hover,
body:not(.login):not(.popup) #header .framework-account-popover > a:focus,
body:not(.login):not(.popup) #header .framework-account-popover > form button:hover,
body:not(.login):not(.popup) #header .framework-account-popover > form button:focus {
    background: var(--fw-muted);
    color: var(--fw-foreground);
}

.framework-account-popover .theme-toggle {
    width: 100%;
    min-height: 2rem;
    justify-content: flex-start;
    border-radius: var(--fw-radius);
}

body:not(.login):not(.popup) #header #user-tools strong {
    color: var(--fw-foreground);
    font-weight: 600;
}

body:not(.login):not(.popup) #header #user-tools a,
body:not(.login):not(.popup) #header #user-tools button {
    padding: 0.25rem;
    border-radius: var(--fw-radius);
    color: var(--fw-muted-foreground);
    font-size: inherit;
    font-weight: 500;
    text-transform: none;
}

body:not(.login):not(.popup) #header #user-tools a:hover,
body:not(.login):not(.popup) #header #user-tools a:focus,
body:not(.login):not(.popup) #header #user-tools button:hover,
body:not(.login):not(.popup) #header #user-tools button:focus {
    background: var(--fw-muted);
    color: var(--fw-foreground);
    text-decoration: none;
}

body:not(.login):not(.popup) #header #logout-form {
    display: block;
}

body:not(.login):not(.popup) #container > nav[aria-label="Breadcrumbs"] {
    display: none;
}

body:not(.login):not(.popup) div.breadcrumbs {
    min-height: 2.25rem;
    box-sizing: border-box;
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--fw-border);
    background: var(--fw-background);
    color: var(--fw-muted-foreground);
    font-size: 0.75rem;
    line-height: 1;
}

body:not(.login):not(.popup) div.breadcrumbs a:hover,
body:not(.login):not(.popup) div.breadcrumbs a:focus {
    color: var(--fw-foreground);
    text-decoration: none;
}

body:not(.login):not(.popup) #container:has(.main.shifted) > #header,
body:not(.login):not(.popup) #container:has(.main.shifted) > nav[aria-label="Breadcrumbs"] {
    margin-inline-start: var(--fw-sidebar-width);
}

body:not(.login):not(.popup) #container > .main {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

body:not(.login):not(.popup) .main > #nav-sidebar {
    position: fixed;
    z-index: 30;
    top: 0.5rem;
    bottom: 0.5rem;
    left: 0.5rem;
    display: flex;
    visibility: visible;
    width: calc(var(--fw-sidebar-width) - 1rem);
    max-height: none;
    box-sizing: border-box;
    flex: none;
    flex-direction: column;
    margin: 0;
    border: 1px solid var(--fw-sidebar-border, var(--fw-border));
    border-radius: 0.5rem;
    background: var(--fw-background);
    overflow: hidden;
    transform: none;
    transition: none;
}

body:not(.login):not(.popup) .main::before {
    position: fixed;
    z-index: -1;
    inset: 0;
    width: auto;
    content: "";
    background: color-mix(in srgb, var(--fw-border) 76%, transparent);
    mask-image: url("../brand/patterns/diagonal.svg");
    mask-position: center;
    mask-repeat: repeat;
    mask-size: 8px 8px;
}

body:not(.login):not(.popup) .main.shifted::before {
    transform: none;
}

body:not(.login):not(.popup) .main.shifted > #nav-sidebar {
    visibility: visible;
    margin: 0;
    transform: translateX(0);
}

body:not(.login):not(.popup) .main > #nav-sidebar + .content,
body:not(.login):not(.popup) .main.shifted > #nav-sidebar + .content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-inline-start: 0;
    border: 1px solid var(--fw-border);
    border-top: 0;
    border-radius: 0 0 0.375rem 0.375rem;
    background: var(--fw-background);
    overflow-y: auto;
    transition: none;
}

body:not(.login):not(.popup) .main.shifted > #nav-sidebar + .content {
    width: calc(100% - var(--fw-sidebar-width) - 0.5rem);
    height: calc(100svh - var(--fw-topbar-height) - 1rem);
    box-sizing: border-box;
    margin-inline-start: var(--fw-sidebar-width);
    margin-inline-end: 0.5rem;
}

.framework-sidebar-brand {
    display: flex;
    min-height: 3rem;
    box-sizing: border-box;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--fw-border);
    color: var(--fw-foreground) !important;
}

.framework-sidebar-brand:hover,
.framework-sidebar-brand:focus {
    background: var(--fw-muted);
    color: var(--fw-foreground) !important;
    text-decoration: none;
}

.framework-sidebar-logo {
    display: block;
    width: 6.5rem;
    height: auto;
}

html[data-theme="light"] .framework-sidebar-logo.framework-admin-logo-light {
    display: block;
}

html[data-theme="light"] .framework-sidebar-logo.framework-admin-logo-dark,
html[data-theme="dark"] .framework-sidebar-logo.framework-admin-logo-light {
    display: none;
}

html[data-theme="dark"] .framework-sidebar-logo.framework-admin-logo-dark {
    display: block;
}

html[data-theme="auto"] .framework-sidebar-logo.framework-admin-logo-light {
    display: block;
}

html[data-theme="auto"] .framework-sidebar-logo.framework-admin-logo-dark {
    display: none;
}

@media (prefers-color-scheme: dark) {
    html[data-theme="auto"] .framework-sidebar-logo.framework-admin-logo-light {
        display: none;
    }

    html[data-theme="auto"] .framework-sidebar-logo.framework-admin-logo-dark {
        display: block;
    }
}

.framework-sidebar-search {
    padding: 0.75rem;
}

#nav-sidebar #nav-filter {
    width: 100%;
    height: 2rem;
    box-sizing: border-box;
    margin: 0;
    padding: 0 0.625rem;
    border: 1px solid var(--fw-input);
    border-radius: var(--fw-radius);
    background: var(--fw-background);
    color: var(--fw-foreground);
    font-size: 0.75rem;
}

#nav-sidebar #nav-filter:focus {
    border-color: var(--fw-ring);
    outline: 0;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--fw-ring) 20%, transparent);
}

.framework-sidebar-content {
    min-height: 0;
    flex: 1;
    padding: 0 0.5rem 0.75rem;
    overflow-y: auto;
}

#nav-sidebar .module {
    margin: 0 0 0.75rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

#nav-sidebar .module table {
    border-collapse: separate;
    border-spacing: 0;
}

#nav-sidebar .module tr,
#nav-sidebar .module tr:nth-child(odd),
#nav-sidebar .module tr:nth-child(even),
#nav-sidebar .module .row1,
#nav-sidebar .module .row2 {
    background: transparent;
}

#nav-sidebar .module caption {
    padding: 0.5rem 0.625rem 0.375rem;
    border: 0;
    background: transparent;
    color: var(--fw-muted-foreground);
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

#nav-sidebar .module caption a,
#nav-sidebar .module caption .framework-sidebar-section {
    color: inherit;
}

#nav-sidebar .module caption .framework-sidebar-section {
    cursor: default;
    text-decoration: none;
}

#nav-sidebar .module th {
    padding: 0;
    border: 0;
    font-weight: 500;
}

#nav-sidebar .module td {
    display: none;
}

#nav-sidebar .module th a {
    display: flex;
    min-height: 2rem;
    box-sizing: border-box;
    align-items: center;
    padding: 0.5rem;
    border-left: 2px solid transparent;
    border-radius: 0;
    color: var(--fw-foreground);
    font-size: 0.875rem;
    transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

#nav-sidebar .module th a:hover,
#nav-sidebar .module th a:focus {
    background: transparent;
    color: var(--fw-orange);
    text-decoration: none;
}

#nav-sidebar .current-model {
    border-left: 0;
    background: transparent;
}

#nav-sidebar .current-model th a {
    border-left-color: var(--fw-orange);
    background: transparent;
    color: var(--fw-foreground);
    font-weight: 600;
}

.framework-sidebar-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid var(--fw-border);
    background: var(--fw-background);
}

.framework-sidebar-user {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.625rem;
}

.framework-sidebar-avatar {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
    align-items: center;
    justify-content: center;
    border-radius: var(--fw-radius);
    background: var(--fw-primary);
    color: var(--fw-primary-foreground);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.framework-sidebar-user-copy {
    display: grid;
    min-width: 0;
    gap: 0.125rem;
}

.framework-sidebar-user-copy strong,
.framework-sidebar-user-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.framework-sidebar-user-copy strong {
    color: var(--fw-foreground);
    font-size: 0.75rem;
    font-weight: 600;
}

.framework-sidebar-user-copy small {
    color: var(--fw-muted-foreground);
    font-size: 0.6875rem;
}

.framework-sidebar-logout button {
    min-height: 1.75rem;
    padding: 0.375rem 0.5rem;
    border: 0;
    border-radius: var(--fw-radius);
    background: transparent;
    color: var(--fw-muted-foreground);
    cursor: pointer;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 500;
}

.framework-sidebar-logout button:hover,
.framework-sidebar-logout button:focus {
    background: var(--fw-muted-strong);
    color: var(--fw-foreground);
}

body:not(.login):not(.popup) .toggle-nav-sidebar {
    position: fixed;
    z-index: 35;
    top: 1rem;
    left: 1rem;
    display: flex;
    width: 2rem;
    height: 2rem;
    flex: none;
    border: 0;
    border-radius: var(--fw-radius);
    background: transparent;
    color: var(--fw-muted-foreground);
    transition: none;
}

body:not(.login):not(.popup) .main.shifted > .toggle-nav-sidebar {
    left: calc(var(--fw-sidebar-width) + 1rem);
}

html[data-admin-sidebar-open="false"] body:not(.login):not(.popup) #header {
    margin-inline-start: 0.5rem;
}

html[data-admin-sidebar-open="false"] body:not(.login):not(.popup) .main > #nav-sidebar {
    visibility: hidden;
    transform: translateX(calc(-100% - 0.5rem));
}

html[data-admin-sidebar-open="false"] body:not(.login):not(.popup) .main > #nav-sidebar + .content {
    width: calc(100% - 1rem);
    margin-inline-start: 0.5rem;
    margin-inline-end: 0.5rem;
}

html[data-admin-sidebar-open="false"] body:not(.login):not(.popup) .toggle-nav-sidebar {
    left: 1rem;
}

html[data-admin-sidebar-open="true"] body:not(.login):not(.popup) #header {
    margin-inline-start: var(--fw-sidebar-width);
}

html[data-admin-sidebar-open="true"] body:not(.login):not(.popup) .main > #nav-sidebar {
    visibility: visible;
    transform: none;
}

html[data-admin-sidebar-open="true"] body:not(.login):not(.popup) .main > #nav-sidebar + .content {
    width: calc(100% - var(--fw-sidebar-width) - 0.5rem);
    margin-inline-start: var(--fw-sidebar-width);
    margin-inline-end: 0.5rem;
}

html[data-admin-sidebar-open="true"] body:not(.login):not(.popup) .toggle-nav-sidebar {
    left: calc(var(--fw-sidebar-width) + 1rem);
}

body:not(.login):not(.popup) .toggle-nav-sidebar::before {
    content: "›";
    font-size: 1.25rem;
    line-height: 1;
}

body:not(.login):not(.popup) .main.shifted > .toggle-nav-sidebar::before {
    content: "‹";
}

body:not(.login):not(.popup) .toggle-nav-sidebar:hover,
body:not(.login):not(.popup) .toggle-nav-sidebar:focus {
    background: var(--fw-muted);
    color: var(--fw-foreground);
}

body:not(.login):not(.popup) #content {
    position: relative;
    width: auto;
    max-width: 90rem;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 1rem;
}

body:not(.login):not(.popup) #content > h1 {
    margin: 0 0 1rem;
}

body:not(.login):not(.popup) #content > h2 {
    margin: -0.5rem 0 1rem;
    color: var(--fw-muted-foreground);
    font-size: 0.875rem;
    font-weight: 500;
}

h2 {
    font-size: 1.125rem;
    line-height: 1.25;
}

h3 {
    font-size: 1rem;
    line-height: 1.25;
}

.module,
.inline-group,
.submit-row,
#changelist-filter,
.selector-available,
.selector-chosen {
    border-radius: 6px;
    box-shadow: none;
}

.module h2,
.module caption,
.inline-group h2,
fieldset.collapse summary {
    padding: 0.75rem 1rem;
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
textarea,
select,
.vTextField {
    min-height: var(--fw-control-height);
    box-sizing: border-box;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25;
}

textarea {
    min-height: 5rem;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--fw-primary);
}

.button,
input[type="submit"],
input[type="button"],
.submit-row input,
a.button,
.object-tools a:link,
.object-tools a:visited {
    display: inline-flex;
    min-height: 2rem;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.625rem;
    border: 1px solid transparent;
    border-radius: var(--fw-radius);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0;
    text-transform: none;
}

.button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.submit-row input:hover,
a.button:hover,
.object-tools a:hover,
.object-tools a:focus {
    background: color-mix(in srgb, var(--fw-primary) 85%, var(--fw-background));
    color: var(--fw-primary-foreground);
}

.button:focus-visible,
input[type="submit"]:focus-visible,
input[type="button"]:focus-visible,
.submit-row input:focus-visible,
a.button:focus-visible,
.object-tools a:focus-visible {
    border-color: var(--fw-ring);
    outline: 0;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--fw-ring) 25%, transparent);
}

.object-tools {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    margin: 0 0 1rem;
}

.change-list #content-main > .object-tools,
.change-form #content-main > .object-tools {
    position: absolute;
    z-index: 2;
    top: 1rem;
    right: 1rem;
    width: auto;
    margin: 0;
}

.change-list #content > h1,
.change-form #content > h1 {
    min-height: 2rem;
    box-sizing: border-box;
    padding-right: 12rem;
}

.object-tools li,
.object-tools li + li {
    margin: 0;
}

.object-tools a:link,
.object-tools a:visited {
    float: none;
    padding-inline: 0.75rem;
}

/* Django action-link icons are intentionally omitted to match text-only buttons. */
.addlink,
.changelink,
.inlinechangelink,
.deletelink,
.viewlink,
.inlineviewlink,
.viewsitelink,
.historylink {
    padding-left: 0 !important;
    background-image: none !important;
}

.object-tools .addlink,
.object-tools .viewsitelink,
.object-tools .historylink,
.object-tools .viewlink,
.object-tools .editlink {
    padding-inline: 0.75rem !important;
    background-image: none !important;
}

.submit-row a.deletelink {
    padding-inline: 0.75rem !important;
}

.addlink::before,
.changelink::before,
.inlinechangelink::before,
.deletelink::before,
.viewlink::before,
.inlineviewlink::before,
.viewsitelink::before,
.historylink::before,
.object-tools a::before {
    display: none !important;
    content: none !important;
}

table thead th,
table thead td,
.results thead th {
    height: 2.75rem;
    box-sizing: border-box;
    padding: 0.75rem 1rem;
    font-weight: 500;
}

table tbody th,
table tbody td {
    min-height: 3rem;
    box-sizing: border-box;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--fw-border);
    font-size: 0.875rem;
    vertical-align: middle;
}

table tbody tr:hover,
#changelist tbody tr:hover {
    background: color-mix(in srgb, var(--fw-muted) 60%, var(--fw-card));
}

#changelist tbody tr.selected,
#changelist tbody tr:has(.action-select:checked) {
    background: var(--fw-muted-strong);
}

#toolbar {
    margin: 0 0 0.75rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

#toolbar form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

#toolbar #searchbar {
    width: min(28rem, 100%);
    flex: 0 1 28rem;
    height: var(--fw-control-height);
    margin: 0;
    padding: 0.5rem 0.75rem;
    border-color: var(--fw-input);
    background: var(--fw-background);
    font-size: 0.875rem;
}

#toolbar form input[type="submit"],
#changelist .actions .button {
    height: 2rem;
    border: 1px solid var(--fw-border);
    background: var(--fw-card);
    box-shadow: none;
    color: var(--fw-foreground);
}

#toolbar .search-result-count {
    display: inline-flex;
    min-height: 2rem;
    align-items: center;
    margin: 0;
}

/* Changelists are flat data surfaces, not cards nested inside the page. */
.change-list #changelist,
.change-list #changelist.filtered,
.change-list #changelist-form .results {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.change-list #changelist-form .results table {
    border-collapse: collapse;
    border-top: 1px solid var(--fw-border);
    border-bottom: 1px solid var(--fw-border);
    background: transparent;
}

.change-list #changelist-form .results thead th,
.change-list #changelist-form .results thead td {
    background: transparent;
}

.change-list #changelist .actions,
.change-list .paginator,
.change-list .changelist-footer,
.change-list #changelist .changelist-footer {
    border-inline: 0;
    border-radius: 0;
    background: transparent;
}

/* Change-form tools stay in flow above fields and inline tables. */
.change-form #content-main > .object-tools {
    width: auto;
    min-height: 2rem;
    align-items: center;
}

.change-form #content-main > form {
    clear: both;
}

#toolbar form input[type="submit"]:hover,
#changelist .actions .button:hover {
    background: var(--fw-muted);
    color: var(--fw-foreground);
}

#changelist .actions {
    box-sizing: border-box;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--fw-border);
    border-bottom: 0;
    border-radius: 6px 6px 0 0;
    background: var(--fw-card);
}

#changelist .actions select {
    height: 2rem;
    margin-left: 0.5rem;
    padding: 0.25rem 2rem 0.25rem 0.5rem;
    background: var(--fw-card);
}

#changelist-form .results {
    border: 1px solid var(--fw-border);
    border-radius: 0 0 6px 6px;
    background: var(--fw-card);
}

#changelist-filter {
    flex-basis: 15rem;
    margin-left: 1rem;
    background: var(--fw-card);
}

#changelist-filter h2 {
    margin: 0;
    padding: 0.75rem 1rem;
}

#changelist-filter h3,
#changelist-filter details summary {
    padding: 0 1rem;
}

#changelist-filter ul {
    padding: 0 1rem 0.75rem;
}

#changelist-filter li.selected {
    margin-left: -1rem;
    padding-left: 0.75rem;
    border-left: 2px solid var(--fw-orange);
}

.paginator,
.changelist-footer,
#changelist .changelist-footer {
    padding: 0.75rem 1rem;
    border: 1px solid var(--fw-border);
    border-top: 0;
    border-radius: 0 0 6px 6px;
    background: var(--fw-card);
    font-size: 0.8125rem;
}

.form-row {
    padding: 0.875rem 1rem;
}

.aligned label {
    color: var(--fw-foreground);
    font-size: 0.8125rem;
    font-weight: 500;
}

.help,
p.help,
form p.help,
div.help,
form div.help,
div.help li {
    margin-top: 0.375rem;
    font-size: 0.75rem;
    line-height: 1.5;
}

.submit-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem;
}

.submit-row p,
.submit-row p.deletelink-box {
    margin: 0 auto 0 0;
}

ul.messagelist {
    padding: 1rem 1.25rem 0;
}

ul.messagelist li {
    max-width: 90rem;
    box-sizing: border-box;
    margin: 0 auto 0.75rem;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    background-position: 1rem center;
}

.dashboard #content {
    display: grid;
    width: auto;
    grid-template-columns: minmax(0, 1fr) minmax(14rem, 18rem);
    gap: 1rem;
}

.dashboard #content > h1 {
    grid-column: 1 / -1;
}

.dashboard #content-main {
    display: grid;
    float: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 1rem;
}

.dashboard #content-main .module {
    margin: 0;
}

.dashboard #content-related {
    position: static;
    float: none;
    width: auto;
    margin: 0;
    border: 0;
    background: transparent;
}

.dashboard #content-related .module {
    border: 1px solid var(--fw-border);
    background: var(--fw-card);
}

.dashboard #content-related h3 {
    margin: 0;
    padding: 0.75rem 1rem 0;
    color: var(--fw-muted-foreground);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dashboard #content-related .actionlist {
    margin: 0;
    padding: 0.5rem 1rem 1rem;
}

.dashboard #content-related .actionlist li {
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--fw-border);
    font-size: 0.8125rem;
}

.dashboard #content-related .actionlist li:last-child {
    border-bottom: 0;
}

body.login #container {
    width: min(26rem, calc(100% - 2rem));
    border-radius: 6px;
    box-shadow: var(--fw-shadow);
}

body.login #header {
    padding: 1rem;
}

body.login #content {
    padding: 1.5rem;
}

body.login #content h1 {
    font-size: 1.375rem;
}

@media (max-width: 1024px) {
    .dashboard #content {
        grid-template-columns: 1fr;
    }

    .dashboard #content > h1,
    .dashboard #content-main,
    .dashboard #content-related {
        grid-column: 1;
    }

    #changelist .changelist-form-container {
        display: block;
    }

    #changelist .changelist-form-container:has(#changelist-filter) > div {
        max-width: none;
    }

    #changelist-filter {
        width: auto;
        margin: 1rem 0 0;
    }
}

@media (max-width: 767px) {
    body:not(.login):not(.popup) #container:has(.main.shifted) > #header,
    body:not(.login):not(.popup) #container:has(.main.shifted) > nav[aria-label="Breadcrumbs"] {
        margin-inline-start: 0;
    }

    body:not(.login):not(.popup) .main > #nav-sidebar {
        display: flex;
        top: 0.5rem;
        bottom: 0.5rem;
        width: min(calc(var(--fw-sidebar-width) - 1rem), calc(100vw - 4rem));
        box-shadow: 1rem 0 3rem rgba(11, 10, 9, 0.18);
    }

    body:not(.login):not(.popup) .main.shifted > #nav-sidebar + .content {
        width: 100%;
        margin-inline-start: 0;
    }

    body:not(.login):not(.popup) .main.shifted > .toggle-nav-sidebar {
        left: calc(min(var(--fw-sidebar-width), calc(100vw - 3rem)) + 0.5rem);
    }

    html[data-admin-sidebar-open="true"] body:not(.login):not(.popup) #header,
    html[data-admin-sidebar-open="false"] body:not(.login):not(.popup) #header {
        margin-inline-start: 0.5rem;
    }

    html[data-admin-sidebar-open="true"] body:not(.login):not(.popup) .main > #nav-sidebar + .content,
    html[data-admin-sidebar-open="false"] body:not(.login):not(.popup) .main > #nav-sidebar + .content {
        width: calc(100% - 1rem);
        margin-inline-start: 0.5rem;
        margin-inline-end: 0.5rem;
    }

    html[data-admin-sidebar-open="true"] body:not(.login):not(.popup) .toggle-nav-sidebar {
        left: calc(min(var(--fw-sidebar-width), calc(100vw - 3rem)) + 0.5rem);
    }

    body:not(.login):not(.popup) #header {
        min-height: 3rem;
        padding-left: 3rem;
    }

    body:not(.login):not(.popup) #header #user-tools {
        max-width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }

    body:not(.login):not(.popup) #content {
        padding: 1rem;
    }

    .dashboard #content-main {
        grid-template-columns: 1fr;
    }

    .object-tools {
        position: static !important;
        justify-content: flex-start;
        margin: 0 0 1rem;
    }

    .change-list #content > h1,
    .change-form #content > h1 {
        padding-right: 0;
    }

    #toolbar form {
        align-items: stretch;
        flex-direction: column;
    }

    #toolbar #searchbar {
        width: 100%;
    }

    .submit-row,
    .submit-row input,
    .submit-row a {
        width: 100%;
    }

    .submit-row p,
    .submit-row p.deletelink-box {
        width: 100%;
        margin: 0;
    }
}

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

/* These precision overrides intentionally follow Django's changelist CSS. */
.change-list #changelist .changelist-form-container,
.change-list #changelist .changelist-form-container:has(#changelist-filter),
.change-list #changelist .changelist-form-container:has(#changelist-filter) > .framework-changelist-main {
    display: block;
    width: 100%;
    max-width: none;
    min-width: 0;
}

.change-list #changelist-filter {
    width: 100%;
    flex-basis: auto;
    margin: 0 0 0.5rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: transparent;
}

.change-list #changelist-filter details > summary {
    padding: 0;
}

.change-list #changelist-filter details > summary::before {
    display: none;
    content: none;
}

.change-list #changelist-filter details summary > .framework-filter-label {
    display: block;
}

.change-list #changelist-filter details summary > .framework-filter-trigger {
    display: flex;
}

.change-list #changelist-filter .framework-filter > ul {
    position: absolute;
    z-index: 20;
    top: calc(100% + 0.25rem);
    left: 0;
    width: max-content;
    min-width: 100%;
    max-width: min(22rem, calc(100vw - 2rem));
    max-height: 18rem;
    overflow-y: auto;
    margin: 0;
    padding: 0.25rem;
    border: 1px solid var(--fw-border);
    border-radius: 6px;
    background: var(--fw-card);
    box-shadow: 0 4px 12px rgba(11, 10, 9, 0.12);
}

.change-list #changelist-filter .framework-filter li,
.change-list #changelist-filter .framework-filter li.selected {
    margin: 0;
    padding: 0;
    border: 0;
}

.change-list #changelist-filter .framework-filter li a {
    padding: 0.375rem 0.5rem;
}

.change-list #changelist .actions {
    margin: 0 0 0.5rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.change-list #changelist .actions select {
    margin: 0;
}

.change-list #changelist-form .results {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--fw-border);
    border-radius: 4px 4px 0 0;
    background: var(--fw-card);
}

.change-list #changelist-form .results table {
    border: 0;
    background: var(--fw-card);
}

.change-list #changelist-form .results thead th,
.change-list #changelist-form .results thead td {
    background: transparent;
}

.change-list #changelist-form .changelist-footer {
    width: 100%;
    margin: 0;
    padding: 0 1rem;
    border: 1px solid var(--fw-border);
    border-top: 0;
    border-radius: 0 0 4px 4px;
    background: var(--fw-card);
}

.change-list #changelist-form .paginator {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

#content .framework-page-back,
#content .framework-page-back:link,
#content .framework-page-back:visited {
    color: var(--fw-muted-foreground);
    text-decoration: none;
}

#content .framework-page-back:hover,
#content .framework-page-back:focus-visible {
    color: var(--fw-foreground);
    text-decoration: none;
}
