:root {
    --sonnite-yellow: #ffa600;
    --sonnite-font-heading: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --sonnite-font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --page-title-size: 2rem;
    --color-brand: #ffa600;
    --color-brand-hover: #e89400;
    --color-on-brand: #211500;
    --color-text: #24221f;
    --color-text-muted: #68635b;
    --color-surface: #fff;
    --color-surface-subtle: #f7f5f1;
    --color-border: #d8d3ca;
    --color-border-strong: #aaa39a;
    --color-danger: #9c1831;
    --color-danger-hover: #701124;
    --color-danger-soft: #fae9ed;
    --color-success: #23672d;
    --color-success-soft: #e5f4e8;
    --color-warning: #714900;
    --color-warning-soft: #fff3d9;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --radius-control: 0.4rem;
    --radius-card: 0.75rem;
    --radius-pill: 999px;
    --shadow-sm: 0 0.25rem 0.75rem rgb(33 26 14 / 8%);
    --shadow-md: 0 0.75rem 1.75rem rgb(33 26 14 / 10%);
    --shadow-popover: 0 0.75rem 1.5rem rgb(0 0 0 / 14%);
    --control-height: 2.625rem;
    --container-narrow: 48rem;
    --container-reading: 60rem;
    --container-wide: 76rem;
    --container-workspace: 96rem;
}

.brochure-filters {
    align-items: end;
    grid-template-columns: minmax(16rem, 32rem) auto;
    margin-bottom: 1.25rem;
}

.marketing-brochure-card > img {
    border-radius: 0.55rem;
    height: 5rem;
    object-fit: cover;
    width: 5rem;
}

.marketing-brochure-card .marketing-tag-list,
.brochure-detail-heading .marketing-tag-list {
    margin-top: 0.75rem;
}

.brochure-detail-heading {
    align-items: start;
}

.brochure-header-image {
    border-radius: 0.8rem;
    display: block;
    margin: 1rem 0;
    max-height: 30rem;
    object-fit: cover;
    width: 100%;
}

.brochure-render-card {
    margin: 1rem 0;
}

.brochure-render-card .project-profile-render-form {
    flex-wrap: wrap;
}

.brochure-body-sections {
    display: grid;
    gap: 1rem;
}

.brochure-image-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    margin: 1rem 0;
}

.brochure-image-grid img {
    border-radius: 0.7rem;
    height: 16rem;
    object-fit: cover;
    width: 100%;
}

.brochure-image-order {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.brochure-image-order-item {
    align-items: center;
    background: var(--surface-subtle, #f7f6f3);
    border: 1px solid var(--border-color, #ddd8d0);
    border-radius: 0.6rem;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 5rem minmax(5rem, 1fr) auto;
    padding: 0.65rem;
}

.brochure-image-order-item img {
    border-radius: 0.4rem;
    height: 4rem;
    object-fit: cover;
    width: 5rem;
}

.brochure-image-order-item > div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.brochure-image-order-item .button {
    padding: 0.4rem 0.65rem;
}

.brochure-legacy-file {
    margin-top: 1rem;
}

@media (max-width: 700px) {
    .brochure-filters,
    .brochure-image-order-item {
        grid-template-columns: 1fr;
    }
}

/* Shared UI system. Kept after feature rules so common components have one
   predictable appearance while feature classes continue to define layout. */
*,
*::before,
*::after {
    box-sizing: border-box;
}

button,
input,
select,
textarea {
    font: inherit;
}

:where(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid rgb(255 166 0 / 45%);
    outline-offset: 2px;
}

:where(input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
    min-height: var(--control-height);
    border-color: var(--color-border-strong);
    border-radius: var(--radius-control);
    background-color: var(--color-surface);
    color: var(--color-text);
}

:where(input, select, textarea):disabled {
    cursor: not-allowed;
    background: var(--color-surface-subtle);
    color: var(--color-text-muted);
}

.button {
    display: inline-flex;
    min-height: var(--control-height);
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.55rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-control);
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.button:hover {
    filter: none;
}

.button.button--primary {
    border-color: var(--color-brand);
    background: var(--color-brand);
    color: var(--color-on-brand);
}

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

.button.button--secondary {
    border-color: var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
}

.button.button--secondary:hover,
.button.button--ghost:hover {
    border-color: var(--color-border-strong);
    background: var(--color-surface-subtle);
}

.button.button--danger {
    border-color: var(--color-danger);
    background: var(--color-danger);
    color: #fff;
}

.button.button--danger:hover {
    border-color: var(--color-danger-hover);
    background: var(--color-danger-hover);
}

.button.button--ghost {
    border-color: transparent;
    background: transparent;
    color: var(--color-text);
}

.button--small {
    min-height: 2.125rem;
    padding: 0.35rem 0.65rem;
    font-size: 0.875rem;
}

.button--icon {
    width: 2.25rem;
    min-width: 2.25rem;
    min-height: 2.25rem;
    padding: var(--space-2);
}

.button:disabled,
.button[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.55;
}

.select-control {
    width: 100%;
    min-height: var(--control-height);
    padding: 0.55rem 2.25rem 0.55rem 0.75rem;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-control);
    background-color: var(--color-surface);
    color: var(--color-text);
}

.select-control[multiple] {
    padding-right: 0.75rem;
}

.page-shell {
    width: min(100%, var(--container-wide));
    margin-inline: auto;
    padding-block: var(--space-7) 5rem;
}

.page-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: var(--space-6);
    margin-bottom: var(--space-6);
}

.page-header__content {
    display: grid;
    gap: var(--space-2);
}

.page-header__content > *,
.page-header__actions > * {
    margin-block: 0;
}

.page-header__actions,
.form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.page-title {
    margin-block: 0;
    color: var(--color-text);
}

.page-description {
    max-width: 68ch;
    margin-block: 0.4rem 0;
    color: var(--color-text-muted);
}

.login-heading {
    display: grid;
    gap: var(--space-2);
    width: 100%;
    text-align: center;
}

.login-heading > * {
    margin-block: 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--color-warning);
    font-weight: 700;
    text-decoration: none;
}

.back-link::before {
    content: "←";
}

.back-link:hover {
    text-decoration: underline;
}

.status-message {
    margin: 0;
    padding: var(--space-3) var(--space-4);
    border: 1px solid currentcolor;
    border-radius: var(--radius-control);
}

.status-message--error {
    background: var(--color-danger-soft);
    color: var(--color-danger);
}

.status-message--success {
    background: var(--color-success-soft);
    color: var(--color-success);
}

.empty-state {
    display: grid;
    justify-items: center;
    gap: var(--space-2);
    padding: var(--space-7) var(--space-5);
    border: 1px dashed var(--color-border-strong);
    border-radius: var(--radius-card);
    background: var(--color-surface-subtle);
    color: var(--color-text-muted);
    text-align: center;
}

.empty-state > * {
    margin-block: 0;
}

.empty-state h2 {
    color: var(--color-text);
    font-family: var(--sonnite-font-heading);
}

.empty-state__actions {
    margin-top: var(--space-3);
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-control);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
}

.data-table th,
.data-table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    background: var(--color-surface-subtle);
    font-family: var(--sonnite-font-heading);
    font-size: 0.875rem;
}

.data-table tbody tr:last-child > * {
    border-bottom: 0;
}

.tabs {
    display: flex;
    gap: var(--space-1);
    overflow-x: auto;
    border-bottom: 1px solid var(--color-border);
}

.tabs a {
    padding: var(--space-4) var(--space-5) 0.8rem;
    border-bottom: 3px solid transparent;
    color: var(--color-text-muted);
    font-family: var(--sonnite-font-heading);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.tabs a:is(.active, [aria-current="page"]) {
    border-bottom-color: var(--color-brand);
    color: var(--color-text);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-pill);
    background: var(--color-surface-subtle);
    color: var(--color-text-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

@media (max-width: 42rem) {
    .page-shell {
        padding-block: var(--space-6) var(--space-7);
    }

    .page-header {
        align-items: stretch;
        flex-direction: column;
        gap: var(--space-4);
    }

    .page-header__actions,
    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .page-header__actions .button,
    .form-actions .button {
        width: 100%;
    }
}

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

/* Marketing */
.project-profile-detail-page,
.project-profile-editor-page,
.marketing-template-editor-page {
    width: min(100%, 76rem);
    margin-inline: auto;
    padding-block: 2.75rem 4rem;
}

.project-profiles-toolbar h2,
.project-profiles-toolbar p,
.project-profile-render-card h2,
.project-profile-render-card p {
    margin-block: 0;
}

.marketing-placeholder-label {
    color: #8a5900;
    font-family: var(--sonnite-font-heading);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.marketing-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0 1.5rem;
    border-bottom: 1px solid #ddd;
    background: #fff;
}

.marketing-tabs a {
    padding: 1rem 1.25rem 0.85rem;
    border-bottom: 3px solid transparent;
    color: #555;
    font-family: var(--sonnite-font-heading);
    font-weight: 700;
    text-decoration: none;
}

.marketing-tabs a.active {
    border-bottom-color: var(--sonnite-yellow);
    color: #222;
}

.marketing-placeholder,
.project-profiles-panel {
    padding: 2rem;
    border: 1px solid #ddd;
    border-top: 0;
    border-radius: 0 0 1rem 1rem;
}

.marketing-placeholder {
    min-height: 12rem;
}

.project-profiles-toolbar,
.project-profile-title-row,
.project-profile-render-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.button,
a.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1rem;
    border-radius: 0.35rem;
    background: var(--sonnite-yellow);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

a.secondary-button {
    background: #eee;
    color: #222;
}

.project-profile-filters {
    display: grid;
	grid-template-columns: minmax(16rem, 1fr) minmax(12rem, 0.45fr);
	align-items: start;
    gap: 1rem;
	margin-bottom: 1.75rem;
    padding: 1.25rem;
    border-radius: 0.65rem;
    background: #f5f5f5;
}

.project-profile-tag-filter,
.project-profile-team-filter,
.project-profile-form-grid > div,
.project-profile-render-card form {
    display: grid;
    gap: 0.4rem;
}

.project-profile-filter-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.project-profile-clear-tags {
	padding: 0.35rem 0.65rem;
	font-size: 0.85rem;
}

.project-profile-team-filter .button {
	justify-self: start;
	margin-top: 0.35rem;
}

.project-profile-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 0.35rem;
	margin-block: 1rem;
}

.project-profile-pagination a,
.project-profile-pagination span {
	min-width: 1.3rem;
	padding: 0.42rem 0.6rem;
	border: 1px solid #ccc;
	border-radius: 0.35rem;
	color: inherit;
	text-align: center;
	text-decoration: none;
}

.project-profile-pagination a:hover,
.project-profile-pagination .current-page {
	border-color: var(--sonnite-yellow);
	background: #fff4dd;
}

.project-profile-pagination .current-page {
	font-weight: 800;
}

.project-profile-create-row {
	display: flex;
	justify-content: flex-end;
	margin-top: 1.25rem;
}

.project-profile-render-actions,
.marketing-template-pane-heading,
.marketing-template-editor-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.project-profile-render-actions {
    grid-column: 1 / -1;
}

.marketing-templates-panel .marketing-empty {
    margin-top: 1.75rem;
}

.marketing-template-editor-page {
    width: min(100%, 96rem);
}

.marketing-template-editor-heading {
    margin-block: 1rem;
    padding-bottom: 1rem;
}

.marketing-template-editor-heading p,
.marketing-template-editor-heading h1,
.marketing-template-pane-heading h2,
.marketing-template-variables h2 {
    margin-block: 0;
}

.marketing-template-form {
    gap: 1.25rem;
}

.marketing-template-meta {
    display: grid;
    grid-template-columns: minmax(16rem, 2fr) minmax(12rem, 1fr);
    gap: 1rem;
}

.marketing-template-meta > div {
    display: grid;
    gap: 0.4rem;
}

.marketing-template-workspace {
    display: grid;
    grid-template-columns: minmax(24rem, 1fr) minmax(13rem, 0.42fr) minmax(24rem, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.marketing-template-source,
.marketing-template-preview,
.marketing-template-variables {
    min-width: 0;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 0.65rem;
    background: #fff;
}

.marketing-template-source textarea {
    width: 100%;
    min-height: 42rem;
    margin-top: 0.75rem;
    box-sizing: border-box;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.88rem;
    line-height: 1.5;
    tab-size: 2;
}

.marketing-template-preview {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 0.75rem;
}

.marketing-template-preview iframe {
    width: 100%;
    min-height: 42rem;
    border: 1px solid #bbb;
    background: #f5f5f5;
}

.marketing-template-variables {
    align-self: start;
}

.marketing-template-variable {
    display: grid;
    gap: 0.2rem;
    padding-block: 0.65rem;
    border-bottom: 1px solid #eee;
}

.marketing-template-variable span,
.marketing-template-variable small {
    color: #666;
}

.project-profile-filters label,
.project-profile-render-card label {
    font-family: var(--sonnite-font-heading);
    font-weight: 700;
}

.project-profile-filters select,
.project-profile-render-card select,
.project-profile-form select,
.project-profile-form textarea {
    padding: 0.7rem;
    border: 1px solid #ccc;
    border-radius: 0.35rem;
    background: #fff;
    font: inherit;
}

.project-profile-filter-actions {
    display: flex !important;
    grid-auto-flow: column;
    gap: 0.5rem !important;
}

.project-profile-table td {
    vertical-align: top;
}

.project-profile-list-link {
    align-items: center;
    display: flex;
    gap: 0.75rem;
}

.project-profile-list-link img {
    border-radius: 0.4rem;
    flex: 0 0 auto;
    height: 3.5rem;
    object-fit: cover;
    width: 3.5rem;
}

.marketing-empty {
    padding: 3rem 1.5rem;
    border: 1px dashed #ccc;
    border-radius: 0.65rem;
    text-align: center;
}

.marketing-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.marketing-tag {
    display: inline-block;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: #eee;
    color: #222;
    font-size: 0.8rem;
    white-space: nowrap;
}

.project-profile-editor-card,
.project-profile-card {
    margin-top: 1rem;
}

.project-profile-editor-card {
    max-width: none;
}

.project-profile-editor-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.project-profile-editor-heading h1 {
    margin: 0;
}

.project-profile-editor-heading-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.project-profile-editor-heading-actions form {
    margin: 0;
}

.project-profile-language-controls {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 1rem;
    margin-block: 1.5rem;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    background: #f7f7f7;
}

.project-profile-language-controls form {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 0;
}

.project-profile-language-controls label {
    width: 100%;
    font-weight: 700;
}

.project-profile-language-controls select {
    min-width: 11rem;
}

.project-profile-translation-input {
    display: flex;
    align-items: end;
    gap: 0.65rem;
}

.project-profile-editor-primary-actions {
    margin-block: 1.5rem 0.5rem;
}

.project-profile-import-card {
    width: min(100%, 46rem);
    margin-top: 1rem;
}

.project-profile-import-form {
    margin-top: 1.5rem;
}

.project-profile-import-form select,
.project-profile-import-form input[type="file"] {
    width: 100%;
    box-sizing: border-box;
}

.project-profile-import-status {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #ddd;
}

.project-profile-import-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.project-profile-import-progress h2,
.project-profile-import-progress p {
    margin: 0;
}

.project-profile-import-spinner {
    width: 1.5rem;
    height: 1.5rem;
    flex: 0 0 auto;
    border: 0.2rem solid #ddd;
    border-top-color: var(--sonnite-color-primary, #333);
    border-radius: 50%;
    animation: project-profile-import-spin 0.8s linear infinite;
}

@keyframes project-profile-import-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 42rem) {
    .project-profile-editor-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .project-profile-editor-heading-actions {
        width: 100%;
    }

    .project-profile-language-controls,
    .project-profile-language-controls form,
    .project-profile-language-controls select,
    .project-profile-translation-input {
        width: 100%;
    }

    .project-profile-translation-input select {
        min-width: 0;
    }
}

.project-profile-form {
    gap: 1rem;
}

.project-profile-edit-details input,
.project-profile-edit-details select,
.project-profile-edit-details textarea {
    width: 100%;
    box-sizing: border-box;
}

.project-profile-edit-details textarea {
    resize: vertical;
}

.project-profile-edit-details .project-profile-tag-field > label,
.project-profile-edit-details .project-profile-image-field > label {
    display: none;
}

.project-profile-image-preview {
    display: block;
    width: auto;
    max-width: min(100%, 24rem);
    max-height: 12rem;
    margin-top: 0.75rem;
    border-radius: 0.35rem;
    object-fit: contain;
}

.project-profile-image-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.project-profile-image-actions input[type="file"] {
    width: auto;
    max-width: 100%;
}

.project-profile-stock-image-dialog {
    width: min(56rem, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    padding: 0;
    border: 0;
    border-radius: 0.75rem;
    box-shadow: 0 1rem 3rem rgb(0 0 0 / 25%);
}

.project-profile-stock-image-dialog::backdrop {
    background: rgb(0 0 0 / 48%);
}

.project-profile-stock-image-dialog-content {
    padding: 1.25rem;
}

.project-profile-stock-image-dialog-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.project-profile-stock-image-dialog-heading h2,
.project-profile-stock-image-dialog-content > p {
    margin: 0;
}

.project-profile-stock-image-grid,
.admin-stock-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.project-profile-stock-image-option {
    display: grid;
    gap: 0.55rem;
    padding: 0.5rem;
    border: 1px solid #d8d2c8;
    background: #fff;
    color: var(--color-text);
    text-align: left;
}

.project-profile-stock-image-option:hover,
.project-profile-stock-image-option:focus-visible {
    border-color: var(--sonnite-yellow);
    filter: none;
}

.project-profile-stock-image-option img {
    width: 100%;
    aspect-ratio: 3 / 2;
    border-radius: 0.3rem;
    object-fit: cover;
}

.project-profile-stock-image-option span {
    font-family: var(--sonnite-font-heading);
    font-weight: 700;
}

.project-profile-body-edit-row textarea {
    min-height: 24rem;
}

.project-profile-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.project-profile-tag-field {
    position: relative;
}

.tag-combobox {
    position: relative;
}

.tag-combobox-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.45rem;
}

.tag-combobox-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.35rem 0.3rem 0.65rem;
    border-radius: 999px;
    background: #eee;
    font-size: 0.85rem;
}

.tag-combobox-pill button {
    display: grid;
    width: 1.35rem;
    height: 1.35rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #ddd;
    color: #333;
    place-items: center;
}

.tag-combobox-input-wrap {
    display: grid;
    grid-template-columns: 1fr auto;
}

.tag-combobox-input-wrap input {
    min-width: 0;
    border-radius: 0.35rem 0 0 0.35rem;
}

.tag-combobox-toggle {
    min-width: 2.75rem;
    padding: 0.65rem;
    border-radius: 0 0.35rem 0.35rem 0;
}

.tag-combobox-options {
    position: absolute;
    z-index: 20;
    top: calc(100% + 0.25rem);
    right: 0;
    left: 0;
    max-height: 19rem;
    overflow-y: auto;
    border: 1px solid #bbb;
    border-radius: 0.4rem;
    background: #fff;
    box-shadow: 0 0.75rem 1.5rem rgb(0 0 0 / 14%);
}

.tag-combobox-options > button {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0.85rem;
    border: 0;
    border-radius: 0;
    background: #fff;
    color: #222;
    text-align: left;
}

.tag-combobox-options > button:hover,
.tag-combobox-options > button.active {
    background: #fff3d9;
}

.tag-combobox-options > button.selected {
    font-weight: 700;
}

.tag-combobox-options small {
    color: #666;
    white-space: nowrap;
}

.tag-combobox-create {
    border-top: 1px solid #ddd !important;
    color: #704800 !important;
    font-weight: 700;
}

.tag-combobox-empty {
    margin: 0;
    padding: 0.85rem;
    color: #666;
}

.tag-combobox-error {
    margin-block: 0.4rem 0;
}

.tag-combobox-fallback {
    width: 100%;
}

.project-profile-card {
	display: grid;
	gap: 1rem;
}

.project-profile-title-card,
.project-profile-render-card,
.project-profile-details-card {
	padding: clamp(1.5rem, 5vw, 4rem);
	border: 1px solid #ddd;
	border-radius: 0.75rem;
	background: #fff;
	box-shadow: 0 0.5rem 1.25rem rgb(0 0 0 / 6%);
}

.project-profile-render-card {
	display: block;
}

.project-profile-detail-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 2rem;
}

.project-profile-detail-header p,
.project-profile-detail-header h1 {
	margin-block: 0;
}

.project-profile-detail-actions {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.project-profile-detail-actions form {
	margin: 0;
}

.project-profile-detail-header h1 {
	max-width: 48rem;
	margin-top: 0.25rem;
	font-family: var(--sonnite-font-heading);
	font-size: var(--page-title-size);
	line-height: 1.15;
}

.project-profile-render-card .project-profile-render-form {
	display: flex;
	align-items: end;
	gap: 0.65rem;
}

.project-profile-render-empty {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.project-profile-render-form > div {
	display: grid;
	gap: 0.4rem;
}

.project-profile-render-form label {
	font-family: var(--sonnite-font-heading);
	font-weight: 700;
}

.project-profile-render-form select {
	min-width: 12rem;
	padding: 0.65rem;
	border: 1px solid #bbb;
	border-radius: 0.35rem;
	background: #fff;
	font: inherit;
}

.project-profile-details-wrap {
	overflow-x: auto;
}

.project-profile-details {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
}

.project-profile-details th,
.project-profile-details td {
	padding: 1rem;
	border-bottom: 1px solid #ddd;
	vertical-align: top;
	text-align: left;
}

.project-profile-details th {
	width: 11rem;
	background: #f5f5f5;
	font-family: var(--sonnite-font-heading);
	font-size: 0.78rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.project-profile-details td {
	overflow-wrap: anywhere;
}

.project-profile-details .markdown-body > :first-child,
.project-profile-multiline > :first-child {
	margin-top: 0;
}

.project-profile-details .markdown-body > :last-child,
.project-profile-multiline > :last-child {
	margin-bottom: 0;
}

.project-profile-detail-image {
	display: block;
	width: auto;
	max-width: min(100%, 24rem);
	max-height: 12rem;
	border-radius: 0.35rem;
	object-fit: contain;
}

.project-profile-markdown {
    max-width: 52rem;
}

@media (max-width: 760px) {
    .project-profile-detail-page,
    .project-profile-editor-page,
    .marketing-template-editor-page {
        padding-block: 1rem 3rem;
    }

    .marketing-placeholder,
    .project-profiles-panel {
        padding: 1.25rem;
    }

    .project-profiles-toolbar,
    .project-profile-title-row {
        align-items: stretch;
        flex-direction: column;
    }

    .project-profile-filters,
    .project-profile-form-grid,
    .marketing-template-meta,
    .marketing-template-workspace {
        grid-template-columns: 1fr;
    }

    .marketing-template-editor-heading,
    .marketing-template-pane-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .project-profile-table-wrap {
        overflow-x: auto;
    }

	.project-profile-detail-header,
	.project-profile-render-card .project-profile-render-form,
	.project-profile-render-empty {
		align-items: stretch;
		flex-direction: column;
	}

	.project-profile-detail-actions,
	.project-profile-detail-actions .button {
		width: 100%;
	}

	.project-profile-detail-actions {
		align-items: stretch;
		flex-direction: column;
	}

	.project-profile-render-form select,
	.project-profile-render-form .button {
		width: 100%;
	}

	.project-profile-details {
		table-layout: auto;
	}

	.project-profile-details th {
		width: 7rem;
	}
}

body {
    margin: 0;
    font-family: var(--sonnite-font-body);
}

.page-title {
    font-family: var(--sonnite-font-heading);
    font-size: var(--page-title-size);
    line-height: 1.15;
    letter-spacing: normal;
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 100vh;
    padding: 2rem;

    box-sizing: border-box;
}

.authenticated-content {
    padding-inline: 2rem;
    box-sizing: border-box;
}

.login-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;

    width: min(100%, 22rem);
}

.login-logo {
    width: 240px;
    max-width: 100%;
    height: auto;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;

    width: 100%;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.login-form label {
    font-family: var(--sonnite-font-heading);
    font-weight: 600;
}

.login-form input {
    padding: 0.9rem 1rem;
    border: 1px solid #ccc;
    border-radius: 0.35rem;
    font: inherit;
    font-size: 1rem;
}

.login-form button {
    margin-top: 0.25rem;
    padding: 0.9rem 1rem;
    font-weight: 700;
}

.login-error {
    min-height: 1.5rem;
    text-align: center;
}

.error {
    margin: 0;
    color: #b00020;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    width: 100%;
    padding: 0.75rem 2rem;

    background: white;
    border-bottom: 3px solid var(--sonnite-yellow);

    box-sizing: border-box;
}

.navbar-brand {
    flex: 0 0 auto;
}

.logo {
    height: 48px;
    width: auto;
    display: block;
}

.navbar-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.navbar-links a {
    text-decoration: none;
    color: #222;
    font-family: var(--sonnite-font-heading);
    font-weight: 600;
}

.navbar-links a:hover {
    color: var(--sonnite-yellow);
}

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

button {
    padding: 0.6rem 1rem;
    border: 0;
    border-radius: 0.35rem;
    background: var(--sonnite-yellow);
    color: white;
    font: inherit;
    cursor: pointer;
}

button:hover {
    filter: brightness(0.95);
}

.auth-button {
    padding: 0.6rem 1rem;
    border: 0;
    border-radius: 0.35rem;
    background: var(--sonnite-yellow);
    color: white;
}

.user-menu {
    position: relative;
}

.user-menu summary {
    cursor: pointer;
    list-style: none;
}

.user-menu summary::-webkit-details-marker {
    display: none;
}

.user-menu-options {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 10;

    min-width: 10rem;
    padding: 0.35rem;

    background: white;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgb(0 0 0 / 12%);
}

.user-menu-options a,
.user-menu-item {
    display: block;
    width: 100%;
    padding: 0.65rem 0.75rem;

    box-sizing: border-box;
    border: 0;
    border-radius: 0.35rem;
    background: transparent;
    color: #222;
    font: inherit;
    text-align: left;
    text-decoration: none;
}

.user-menu-options a:hover,
.user-menu-item:hover {
    background: #f5f5f5;
    filter: none;
}

.user-menu-options form {
    margin: 0;
}

.navbar-auth {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

[x-cloak] {
    display: none !important;
}

.notifications {
    position: relative;
}

.notification-button {
    position: relative;
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 50%;
    background: white;
    color: #222;
    font-size: 1.2rem;
}

.notification-button:hover {
    background: #fff8de;
    filter: none;
}

.notification-icon {
    width: 1.2rem;
    height: 1.2rem;
    fill: currentColor;
}

.notification-badge {
    position: absolute;
    top: -0.35rem;
    right: -0.4rem;
    min-width: 1.25rem;
    height: 1.25rem;
    padding-inline: 0.25rem;
    border: 2px solid white;
    border-radius: 999px;
    background: #b00020;
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.05rem;
    text-align: center;
}

.notification-panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 20;
    width: min(22rem, calc(100vw - 2rem));
    max-height: min(28rem, calc(100vh - 6rem));
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgb(0 0 0 / 12%);
}

.notification-list,
.notification-list form {
    margin: 0;
}

.notification-list form + form {
    border-top: 1px solid #eee;
}

.notification-item {
    display: grid;
    gap: 0.25rem;
    width: 100%;
    padding: 0.85rem 1rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #222;
    text-align: left;
}

.notification-item:hover {
    background: #fff8de;
    filter: none;
}

.notification-item span {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.35;
}

.notification-empty {
    margin: 0;
    padding: 1rem;
    color: #555;
    text-align: center;
}

.profile-card {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border: 1px solid #ddd;
    border-radius: 0.75rem;
    box-shadow: 0 0.5rem 1.25rem rgb(0 0 0 / 6%);
    text-align: center;
}

.profile-card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    text-align: center;
}

.profile-card-header h2 {
    margin-bottom: 0;
}

.profile-card h2,
.profile-card p {
    margin-top: 0;
}

.profile-card-description,
.muted {
    color: #666;
}

.profile-value {
    margin-bottom: 0;
    font-size: 1.15rem;
    font-weight: 700;
}

.profile-form,
.profile-field {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.profile-form {
    align-items: center;
}

.profile-field {
    width: min(100%, 28rem);
}

.profile-field label {
    font-family: var(--sonnite-font-heading);
    font-weight: 600;
}

.profile-field input,
.profile-field select {
    padding: 0.85rem 1rem;
    border: 1px solid #ccc;
    border-radius: 0.35rem;
    font: inherit;
}

.profile-field small {
    color: #666;
}

.profile-journal-checkbox {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
}

.profile-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.secondary-button {
    background: #eee;
    color: #222;
}

.success {
    margin-bottom: 0;
    color: #267a32;
}

.profile-team-table-wrap {
    overflow-x: auto;
    margin-top: 1.25rem;
}

.profile-team-table {
    width: 100%;
    border-collapse: collapse;
}

.profile-team-table th,
.profile-team-table td {
    padding: 0.65rem 0.75rem;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: middle;
}

.profile-team-table th {
    font-family: var(--sonnite-font-heading);
    background: #f5f5f5;
}

.profile-team-table a {
    color: inherit;
    font-weight: 700;
}

.profile-team-logo {
    display: block;
    width: auto;
    max-width: 5rem;
    height: 40px;
    object-fit: contain;
}

.profile-team-logo-placeholder {
    width: 40px;
    box-sizing: border-box;
    border: 1px dashed #ccc;
    border-radius: 0.35rem;
    background: #f5f5f5;
}

.profile-team-role {
    text-transform: capitalize;
}

.profile-team-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.profile-team-message,
.profile-team-form {
    width: 100%;
}

.profile-team-message {
    margin: 0;
}

.profile-team-form {
    display: grid;
    gap: 0.65rem;
    width: 100%;
}

.profile-team-form label {
    font-family: var(--sonnite-font-heading);
    font-weight: 600;
}

.profile-team-form input {
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 0.35rem;
    font: inherit;
}

.profile-team-actions {
    display: flex;
    gap: 0.75rem;
}

.team-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.team-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    justify-items: center;
    gap: 1.25rem;

    padding: 1rem 1.25rem;
    border: 1px solid #ddd;
    border-radius: 0.75rem;
    box-shadow: 0 0.5rem 1.25rem rgb(0 0 0 / 6%);
    color: inherit;
    cursor: pointer;
    text-decoration: none;
}

.team-card:hover {
    border-color: var(--sonnite-yellow);
}

.team-logo {
    flex: 0 0 auto;
    width: auto;
    height: 60px;
    border-radius: 0.5rem;
}

.team-logo-placeholder {
    width: 60px;
    border: 1px dashed #ccc;
    background: #f5f5f5;
}

.team-card h2 {
    margin: 0;
    font-family: var(--sonnite-font-heading);
    font-size: 1.25rem;
    text-align: center;
}

.team-page {
    max-width: 48rem;
    margin-inline: auto;
    padding-block: 2rem;
}

.team-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 2rem;
    text-align: center;
}

.team-detail-field,
.team-logo-value,
.team-detail-value {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.team-detail-field {
    flex-direction: column;
}

.team-detail-value h1,
.team-detail-value p {
    margin: 0;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0.45rem;
    border-radius: 50%;
}

.icon-button svg {
    width: 1.1rem;
    height: 1.1rem;
    fill: currentColor;
}

.team-inline-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: min(100%, 28rem);
}

.team-inline-form input,
.team-inline-form textarea {
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 0.35rem;
    font: inherit;
}

.team-inline-form textarea {
    resize: vertical;
}

.team-inline-form label,
.team-invite h3 {
    font-family: var(--sonnite-font-heading);
    font-weight: 600;
}

.team-inline-form .muted {
    margin: 0;
    font-size: 0.9rem;
}

.team-form-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.team-profile h1 {
    margin: 0;
}

.team-detail-logo {
    width: auto;
    height: 96px;
    border-radius: 0.5rem;
}

.team-description {
    margin-bottom: 2rem;
    padding: 1.25rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
}

.team-colors {
    margin-bottom: 2rem;
    padding: 1.25rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
}

.team-colors-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.team-colors-heading h2,
.team-colors h2,
.team-colors > .success {
    margin: 0;
}

.team-colors .team-inline-form {
    width: 100%;
}

.team-color-list,
.team-color-inputs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.team-color-value,
.team-color-inputs label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.team-color-value > span:last-child,
.team-color-inputs label {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.team-color-value code {
    display: block;
    color: #666;
}

.team-color-swatch,
.team-color-inputs input[type="color"] {
    width: 3.25rem;
    height: 3.25rem;
    border: 1px solid #aaa;
    border-radius: 0.5rem;
}

.team-color-inputs input[type="color"] {
    padding: 0.2rem;
    cursor: pointer;
}

.team-description-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.team-description-heading h2,
.team-description > .muted,
.team-description > .success {
    margin: 0;
}

.team-description .team-inline-form {
    width: 100%;
}

.team-members table {
    width: 100%;
    border-collapse: collapse;
}

.team-members th,
.team-members td {
    padding: 0.85rem 1rem;
    border: 1px solid #ddd;
    text-align: left;
}

.team-members th {
    font-family: var(--sonnite-font-heading);
    background: #f5f5f5;
}

.team-invite {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
}

.team-invite h3,
.team-invite p {
    margin: 0;
}

.welcome-login-link {
    padding: 0.75rem 1rem;
    border-radius: 0.35rem;
    background: var(--sonnite-yellow);
    color: white;
    font-weight: 700;
    text-decoration: none;
}

.admin-status {
    margin-block: 0 0.35rem;
}

.admin-tabs {
    display: flex;
    gap: 0.25rem;
    margin-top: 0;
    overflow-x: auto;
    border-bottom: 1px solid #ddd;
}

.admin-tabs a {
    flex: 0 0 auto;
    padding: 0.85rem 1rem 0.75rem;
    border-bottom: 3px solid transparent;
    color: #555;
    font-family: var(--sonnite-font-heading);
    font-weight: 700;
    text-decoration: none;
}

.admin-tabs a:hover,
.admin-tabs a.active {
    border-bottom-color: var(--sonnite-yellow);
    color: #222;
}

.admin-tab-panel > .admin-section {
    margin-top: 1.25rem;
}

.admin-users-region {
    margin-top: 1.25rem;
}

.admin-section {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border: 1px solid #ddd;
    border-radius: 0.75rem;
}

.admin-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

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

.admin-library-tree {
    overflow: hidden;
    border: 1px solid #d9d3c8;
    border-radius: 0.55rem;
    background: #fffdf9;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 70%);
}

.admin-library-tree-node {
    margin: 0;
}

.admin-library-tree-row {
    display: grid;
    grid-template-columns: 0.8rem 1.15rem minmax(0, auto) 1fr auto;
    gap: 0.55rem;
    align-items: center;
    min-height: 2.65rem;
    padding: 0.2rem 0.45rem;
    border-radius: 0.35rem;
    color: #322d25;
    cursor: pointer;
    list-style: none;
}

.admin-library-tree-row::-webkit-details-marker {
    display: none;
}

summary.admin-library-tree-row::before {
    content: "›";
    color: #7a7061;
    font-size: 1.25rem;
    line-height: 1;
    transform-origin: center;
    transition: transform 120ms ease;
}

.admin-library-tree-node[open] > summary.admin-library-tree-row::before {
    transform: rotate(90deg);
}

.admin-library-tree-row:hover,
.admin-library-tree-row:focus-visible {
    background: #f5efe4;
    outline: none;
}

.admin-library-tree-row strong {
    overflow: hidden;
    font-family: var(--sonnite-font-heading);
    font-size: 0.9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-library-tree-folder {
    position: relative;
    width: 1rem;
    height: 0.72rem;
    border: 1px solid #a86b08;
    border-radius: 0.12rem;
    background: #e8a82f;
    box-sizing: border-box;
}

.admin-library-tree-folder::before {
    position: absolute;
    top: -0.3rem;
    left: -1px;
    width: 0.48rem;
    height: 0.28rem;
    border: 1px solid #a86b08;
    border-bottom: 0;
    border-radius: 0.12rem 0.12rem 0 0;
    background: #f0bd58;
    content: "";
}

.admin-library-tree-root {
    grid-template-columns: 1.15rem minmax(0, 1fr);
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid #e3ddd1;
    border-radius: 0;
    background: #f7f2e9;
    cursor: default;
}

.admin-library-tree-count {
    color: #766d60;
    font-size: 0.75rem;
}

.admin-library-tree-count {
    justify-self: end;
}

.admin-library-tree-level {
    position: relative;
    margin-left: 1.25rem;
    padding: 0.2rem 0.45rem 0.35rem 1rem;
    border-left: 1px solid #d8cfbf;
}

.admin-library-tree-level > .admin-library-tree-node {
    position: relative;
}

.admin-library-tree-level > .admin-library-tree-node::before {
    position: absolute;
    z-index: 1;
    top: 1.32rem;
    left: -1rem;
    width: 0.8rem;
    border-top: 1px solid #d8cfbf;
    content: "";
}

.admin-library-tree-actions {
    display: flex;
    justify-self: end;
    gap: 0.2rem;
    opacity: 0;
    transition: opacity 100ms ease;
}

.admin-library-tree-row:hover .admin-library-tree-actions,
.admin-library-tree-row:focus-within .admin-library-tree-actions {
    opacity: 1;
}

.admin-library-tree-actions .icon-button,
.admin-library-tree-remove {
    width: 1.85rem;
    height: 1.85rem;
    min-height: 0;
    padding: 0.35rem;
    border-radius: 0.3rem;
}

.admin-library-tree-remove {
    background: transparent;
    color: #9c1831;
    font-size: 1.2rem;
    line-height: 1;
}

.admin-library-tree-remove:hover {
    background: #fbe7ea;
    color: #701124;
}

.admin-library-tree-add {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    min-height: 2.25rem;
    padding: 0.25rem 0.55rem;
    border: 1px dashed transparent;
    border-radius: 0.35rem;
    background: transparent;
    color: #756a59;
    font: inherit;
    font-size: 0.8rem;
    text-align: left;
}

.admin-library-tree-add:hover,
.admin-library-tree-add:focus-visible {
    border-color: #d5b36e;
    background: #fff7e8;
    color: #664300;
}

.admin-library-tree-plus {
    display: inline-grid;
    width: 1.25rem;
    height: 1.25rem;
    place-items: center;
    border: 1px solid #b9aa90;
    border-radius: 50%;
    background: white;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

.admin-library-folder-dialog {
    width: min(100% - 2rem, 24rem);
    max-width: none;
    padding: 0;
    border: 0;
    border-radius: 0.65rem;
    background: transparent;
    overflow: visible;
}

.admin-library-folder-dialog::backdrop {
    background: rgb(20 17 12 / 55%);
}

.admin-library-folder-dialog-content {
    position: relative;
    padding: 1.25rem;
    border: 1px solid #ded7ca;
    border-top: 0.3rem solid var(--sonnite-yellow);
    border-radius: 0.65rem;
    background: #fffdf8;
    box-shadow: 0 1rem 2.5rem rgb(33 26 14 / 16%);
}

.admin-library-folder-dialog h2 {
    margin: 0 2rem 0.2rem 0;
}

.admin-library-folder-location {
    display: grid;
    gap: 0.15rem;
    margin: 0 0 0.65rem;
    color: #716858;
    font-size: 0.8rem;
}

.admin-library-folder-location strong {
    color: #4e4537;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.admin-team-link {
    color: inherit;
    font-weight: 700;
}

.admin-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-family: var(--sonnite-font-body) !important;
    font-weight: 400 !important;
}

.admin-checkbox input {
    margin-top: 0.2rem;
}

.team-member-role,
.team-role-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.team-member-role {
    flex-wrap: wrap;
}

.team-role-badge {
    text-transform: capitalize;
}

.team-member-role-form form {
    display: grid;
    gap: 0.5rem;
}

.team-member-role-form select {
    padding: 0.55rem;
    border: 1px solid #ccc;
    border-radius: 0.35rem;
    font: inherit;
}

.admin-table-wrap {
    overflow-x: auto;
}

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

.admin-table th,
.admin-table td {
    padding: 0.75rem;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    font-family: var(--sonnite-font-heading);
    background: #f5f5f5;
}

.admin-badges,
.admin-row-actions,
.admin-form-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-row-actions {
    justify-content: flex-end;
}

.admin-row-actions form {
    margin: 0;
}

.admin-badge {
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: #222;
    color: white;
    font-size: 0.8rem;
}

.admin-badge-muted {
    background: #e7f4e9;
    color: #267a32;
}

.admin-badge-warning {
    background: #fff1d6;
    color: #805000;
}

.danger-button {
    background: #b00020;
}

.admin-form-card {
    padding: 1.5rem;
    border: 1px solid #ddd;
    border-radius: 0.75rem;
    box-shadow: 0 0.5rem 1.25rem rgb(0 0 0 / 6%);
}

.admin-form-card h2 {
    margin-top: 0;
}

.admin-form {
    display: grid;
    gap: 0.65rem;
}

.admin-form label {
    font-family: var(--sonnite-font-heading);
    font-weight: 600;
}

.admin-form input {
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 0.35rem;
    font: inherit;
}

.admin-branding-form {
    max-width: 36rem;
}

.admin-branding-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.admin-branding-preview img {
    width: auto;
    max-width: 10rem;
    height: 4rem;
    object-fit: contain;
}

.admin-branding-preview div,
.admin-branding-colors label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.admin-branding-colors {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-block: 0.75rem;
}

.admin-branding-colors input[type="color"] {
    width: 4rem;
    height: 3rem;
    padding: 0.2rem;
    cursor: pointer;
}

.admin-stock-images {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #ddd;
}

.admin-stock-images .admin-section-heading h3 {
    margin: 0;
}

.admin-stock-image-form {
    max-width: 36rem;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 0.65rem;
    background: #faf9f7;
}

.admin-stock-image-card {
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 0.65rem;
    background: #fff;
}

.admin-stock-image-card > img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
}

.admin-stock-image-card > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem;
}

.admin-stock-image-card form {
    margin: 0;
}

.admin-settings-status {
    margin-bottom: 1rem;
}

.admin-settings-form {
	display: grid;
	grid-template-columns: 1fr;
    gap: 1rem;
}

.admin-settings-service fieldset {
    display: grid;
    align-content: start;
    gap: 0.65rem;
    min-width: 0;
    margin: 0;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 0.55rem;
}

.admin-settings-service legend {
    padding-inline: 0.3rem;
    font-family: var(--sonnite-font-heading);
    font-size: 1.05rem;
    font-weight: 700;
}

.admin-settings-service input {
    width: 100%;
    box-sizing: border-box;
}

.admin-settings-fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	align-items: start;
	gap: 0.85rem 1rem;
}

.admin-settings-fields > div,
.admin-settings-key-fields {
	display: grid;
	gap: 0.45rem;
}

.admin-settings-key-fields {
	grid-column: 1 / -1;
	padding-top: 0.85rem;
	border-top: 1px solid #eee;
}

.admin-settings-key-control {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 0.5rem;
}

.admin-settings-key-control input {
	min-width: 0;
}

.admin-settings-key-clear {
	align-self: stretch;
	white-space: nowrap;
}

.admin-settings-model-field {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 0.5rem;
}

.admin-model-combobox {
    position: relative;
    min-width: 0;
}

.admin-model-combobox-input-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
}

.admin-form .admin-model-combobox-input-wrap input {
    min-width: 0;
    border-radius: 0.35rem 0 0 0.35rem;
    background: #fff;
}

.admin-model-combobox-toggle {
    min-width: 2.75rem;
    padding: 0.65rem;
    border-radius: 0 0.35rem 0.35rem 0;
}

.admin-model-combobox-toggle.open {
	transform: rotate(180deg);
}

.admin-model-combobox-options {
    position: absolute;
    z-index: 20;
    top: calc(100% + 0.25rem);
    right: 0;
    left: 0;
    max-height: 19rem;
    overflow-y: auto;
    border: 1px solid #bbb;
    border-radius: 0.4rem;
    background: #fff;
    box-shadow: 0 0.75rem 1.5rem rgb(0 0 0 / 14%);
}

.admin-model-combobox-options > button {
    display: block;
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 0;
    border-radius: 0;
    background: #fff;
    color: #222;
    text-align: left;
    overflow-wrap: anywhere;
}

.admin-model-combobox-options > button:hover,
.admin-model-combobox-options > button.active {
    background: #fff3d9;
}

.admin-model-combobox-options > button.selected {
    font-weight: 700;
}

.admin-settings-revision,
.admin-settings-help {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.admin-maintenance-actions {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
}

.admin-maintenance-actions > div {
	display: grid;
	align-content: start;
	gap: 0.65rem;
	padding: 1rem;
	border: 1px solid #ddd;
	border-radius: 0.55rem;
}

.admin-maintenance-actions p,
.admin-maintenance-actions form {
	margin: 0;
}

.admin-settings-service-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.35rem;
}

.admin-settings-service-actions .admin-settings-revision {
    margin: 0 0 0 auto;
}

.admin-settings-action-result.htmx-indicator {
    display: none;
    opacity: 1;
}

.admin-settings-action-result.htmx-indicator.htmx-request {
    display: block;
}

.admin-settings-action-result p,
.admin-settings-models-result p {
    margin: 0.55rem 0 0;
}

@media (max-width: 600px) {
	.admin-settings-fields,
	.admin-settings-model-field,
	.admin-maintenance-actions { grid-template-columns: 1fr; }
    .admin-section {
        padding: 1rem;
    }

    .admin-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-library-tree-level {
        margin-left: 0.7rem;
        padding-left: 0.7rem;
    }

    .admin-library-tree-level > .admin-library-tree-node::before {
        left: -0.7rem;
        width: 0.55rem;
    }

    .admin-library-tree-count {
        display: none;
    }

    .admin-library-tree-actions {
        opacity: 1;
    }
}

.discussion-forum-page,
.discussion-compose-page,
.discussion-thread-page {
    width: min(100%, 68rem);
    margin-inline: auto;
    padding-block: 2.5rem 4rem;
}

.discussion-thread-header h1,
.discussion-compose-page h1 {
    margin-block: 0.15rem 0.4rem;
}

.discussion-thread-header p,
.discussion-compose-page p {
    margin-block: 0;
}

.discussion-status {
    margin: 0 0 1.25rem;
    padding: 0.8rem 1rem;
    border: 1px solid currentColor;
    border-radius: 0.5rem;
}

.discussion-options {
    position: relative;
}

.discussion-options > summary {
    cursor: pointer;
    list-style: none;
}

.discussion-options > summary:not(.button) {
    padding: 0.6rem 1rem;
    border-radius: 0.35rem;
    background: #eee;
    font-weight: 700;
}

.discussion-options > summary::-webkit-details-marker {
    display: none;
}

.discussion-options:not([open]) > .discussion-options-menu {
    display: none;
}

.discussion-options-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 5;
    width: min(20rem, calc(100vw - 2rem));
    padding: 1rem;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    background: white;
    box-shadow: 0 0.65rem 1.6rem rgb(0 0 0 / 12%);
}

.forum-create-form {
    display: grid;
    gap: 0.65rem;
}

.forum-create-form label,
.discussion-compose-form label {
    font-family: var(--sonnite-font-heading);
    font-weight: 700;
}

.forum-create-form input,
.discussion-compose-form input,
.discussion-compose-form textarea,
.discussion-reply textarea {
    width: 100%;
    padding: 0.8rem 0.9rem;
    box-sizing: border-box;
    border: 1px solid #bbb;
    border-radius: 0.4rem;
    background: white;
    font: inherit;
}

.forum-list {
    display: grid;
    gap: 1.5rem;
}

.forum-card {
    position: relative;
    display: flex;
    align-items: stretch;
    border: 1px solid #d8d8d8;
    border-radius: 0.8rem;
    background: white;
    box-shadow: 0 0.65rem 1.6rem rgb(0 0 0 / 6%);
}

.forum-overview-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex: 1 1 auto;
    min-width: 0;
    padding: 1.1rem 1.25rem;
    border-radius: 0.75rem;
    background: white;
    color: #222;
    text-decoration: none;
}

.forum-overview-link:hover {
    background: #fffaf0;
}

.forum-overview-title h2,
.forum-overview-title p {
    margin: 0;
}

.forum-overview-title h2 {
    font-family: var(--sonnite-font-heading);
    font-size: 1.2rem;
}

.forum-overview-title p {
    margin-top: 0.2rem;
    color: #666;
    font-size: 0.84rem;
}

.forum-order-options-wrap {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 0.65rem 0.75rem 0.65rem 0;
}

.discussion-options > .forum-options-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    border-radius: 50%;
}

.forum-options-trigger svg {
    width: 1.2rem;
    height: 1.2rem;
    fill: currentColor;
}

.forum-order-menu {
    display: grid;
    gap: 0.65rem;
    width: 10rem;
}

.forum-order-menu form {
    margin: 0;
}

.forum-order-menu button {
    width: 100%;
}

.button-link,
.secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 0.85rem;
    border-radius: 0.35rem;
    background: var(--sonnite-yellow);
    color: white;
    font-weight: 700;
    text-decoration: none;
}

.secondary-link {
    background: #eee;
    color: #222;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.thread-list {
    display: grid;
}

.thread-row {
    display: grid;
    grid-template-columns: 1rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.8rem;
    min-height: 3.5rem;
    padding: 0.75rem 1.2rem;
    border-top: 1px solid #e8e8e8;
    color: inherit;
    text-decoration: none;
}

.thread-row:first-child {
    border-top: 0;
}

.thread-row:hover {
    background: #fff9ed;
}

.thread-unread-slot {
    display: flex;
    justify-content: center;
}

.thread-unread {
    width: 0.62rem;
    height: 0.62rem;
    border-radius: 50%;
    background: var(--sonnite-yellow);
    box-shadow: 0 0 0 3px rgb(255 166 0 / 18%);
}

.thread-summary {
    display: grid;
    min-width: 0;
}

.thread-summary strong {
    overflow: hidden;
    font-family: var(--sonnite-font-heading);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.thread-summary span,
.thread-activity {
    color: #6b6b6b;
    font-size: 0.85rem;
}

.discussion-empty {
    margin: 0;
    padding: 1.4rem 1.2rem;
}

.discussion-empty {
    border: 1px dashed #bbb;
    border-radius: 0.75rem;
    text-align: center;
}

.discussion-empty h2 {
    margin-block: 0 0.35rem;
}

.discussion-back,
.discussion-breadcrumbs a {
    color: #805000;
    font-weight: 700;
}

.forum-detail-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.forum-detail-heading h1 {
    margin: 0;
}

.forum-thread-list {
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 0.75rem;
    box-shadow: 0 0.65rem 1.6rem rgb(0 0 0 / 6%);
}

.forum-options-menu {
    display: grid;
    gap: 0.65rem;
    width: min(24rem, calc(100vw - 2rem));
}

.forum-options-menu p,
.forum-options-menu form {
    margin: 0;
}

.discussion-compose-page {
    width: min(100%, 46rem);
}

.discussion-compose-form {
    display: grid;
    gap: 0.7rem;
    margin-top: 1.5rem;
    padding: 1.4rem;
    border: 1px solid #ddd;
    border-radius: 0.75rem;
    box-shadow: 0 0.65rem 1.6rem rgb(0 0 0 / 6%);
}

.discussion-compose-form textarea,
.discussion-reply textarea {
    resize: vertical;
}

.discussion-form-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.35rem;
}

.discussion-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.discussion-thread-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.thread-options-menu {
    width: min(25rem, calc(100vw - 2rem));
}

.thread-preferences-form {
    display: grid;
    gap: 0.75rem;
}

.thread-preferences-form label {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    line-height: 1.35;
}

.thread-preferences-form input {
    margin-top: 0.18rem;
}

.thread-preferences-form button {
    justify-self: start;
}

.thread-delete-option {
    display: grid;
    gap: 0.65rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
}

.thread-delete-option p,
.thread-delete-option form {
    margin: 0;
}

.discussion-thread-header {
    padding-bottom: 1.2rem;
}

.discussion-title-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.discussion-title-row h1 {
    margin: 0;
}

.discussion-title-form {
    display: grid;
    gap: 0.65rem;
    max-width: 46rem;
}

.discussion-title-form label,
.discussion-post-form label {
    font-family: var(--sonnite-font-heading);
    font-weight: 700;
}

.discussion-title-form input,
.discussion-post-form textarea {
    width: 100%;
    padding: 0.8rem 0.9rem;
    box-sizing: border-box;
    border: 1px solid #bbb;
    border-radius: 0.4rem;
    background: white;
    font: inherit;
}

.post-list {
    display: grid;
    gap: 1rem;
    margin-block: 1.25rem;
}

.discussion-post {
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 0.65rem;
    background: white;
}

.discussion-post header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid #e5e5e5;
    background: #f7f7f7;
}

.discussion-post-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
}

.discussion-post header strong {
    font-family: var(--sonnite-font-heading);
}

.discussion-post header span {
    color: #666;
    font-size: 0.85rem;
}

.post-body {
    padding: 1.1rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.post-edit-status {
    margin: 0;
    padding: 0 1.1rem 1rem;
}

.discussion-post-form {
    overflow: visible;
    padding: 1rem;
}

.discussion-post-form form {
    display: grid;
    gap: 0.65rem;
}

.discussion-post-form textarea {
    resize: vertical;
}

.discussion-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem;
    margin-block: 1rem;
}

.discussion-pagination a,
.discussion-pagination span {
    min-width: 1.3rem;
    padding: 0.42rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 0.35rem;
    color: inherit;
    text-align: center;
    text-decoration: none;
}

.discussion-pagination a:hover,
.discussion-pagination .current-page {
    border-color: var(--sonnite-yellow);
    background: #fff4dd;
}

.discussion-pagination .current-page {
    font-weight: 800;
}

.thread-tools {
    margin-top: 2rem;
}

.discussion-tool-card {
    padding: 1.2rem;
    border: 1px solid #ddd;
    border-radius: 0.65rem;
    background: #fafafa;
}

.discussion-tool-card h2 {
    margin-block: 0 0.9rem;
    font-family: var(--sonnite-font-heading);
    font-size: 1.1rem;
}

.discussion-reply form {
    display: grid;
    gap: 0.75rem;
}

.discussion-reply button {
    justify-self: start;
}

.search-form {
    margin-bottom: 2.2rem;
    padding: 1rem;
    border: 1px solid #dedbd4;
    border-left: 0.35rem solid var(--sonnite-yellow);
    border-radius: 0.7rem;
    background: #fffdf8;
    box-shadow: 0 1rem 2.5rem rgb(33 26 14 / 7%);
}

.search-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-family: var(--sonnite-font-heading);
    font-size: 0.85rem;
    font-weight: 700;
}

.search-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
}

.search-input-row input {
    min-width: 0;
    padding: 0.9rem 1rem;
    border: 1px solid #bbb;
    border-radius: 0.4rem;
    background: white;
    font: inherit;
    font-size: 1.05rem;
}

.search-type-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin: 1rem 0 0;
    padding: 0;
    border: 0;
}

.search-filter-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.search-document-type-filters {
    flex: 1 1 auto;
}

.search-mode-filters {
    flex: 0 0 auto;
    justify-content: flex-end;
}

.search-type-filters legend {
    width: 100%;
    margin-bottom: 0.1rem;
    color: #555;
    font-family: var(--sonnite-font-heading);
    font-size: 0.78rem;
    font-weight: 700;
}

.search-type-filters label {
    position: relative;
    cursor: pointer;
}

.search-type-filters input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.search-type-filters span {
    display: block;
    padding: 0.48rem 0.75rem;
    border: 1px solid #d0cbc1;
    border-radius: 999px;
    background: white;
    color: #555;
    font-size: 0.86rem;
    font-weight: 700;
    transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.search-type-filters input:checked + span {
    border-color: #d58a00;
    background: #fff0d2;
    color: #694400;
}

.search-type-filters input:focus-visible + span {
    outline: 3px solid rgb(255 166 0 / 22%);
    outline-offset: 2px;
}

.search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-height: 10rem;
    color: #694400;
    font-family: var(--sonnite-font-heading);
    font-weight: 700;
}

.search-spinner {
    width: 1.75rem;
    height: 1.75rem;
    flex: 0 0 auto;
    border: 0.22rem solid #eadfc9;
    border-top-color: #d58a00;
    border-radius: 50%;
    animation: search-spin 0.8s linear infinite;
}

@keyframes search-spin {
    to { transform: rotate(360deg); }
}

.search-results-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #ddd;
}

.search-results-heading p {
    margin: 0;
    overflow-wrap: anywhere;
}

.search-results-heading span,
.search-source {
    color: #7b5000;
    font-family: var(--sonnite-font-heading);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.search-results-heading span {
    flex: 0 0 auto;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    background: #fff1d5;
}

.search-result-list {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.search-result-list li {
    border-bottom: 1px solid #e5e5e5;
}

.search-result {
    display: block;
    padding: 1.35rem 0.85rem;
    color: inherit;
    text-decoration: none;
    transition: background 120ms ease, padding 120ms ease;
}

.search-result:hover {
    padding-inline: 1.1rem 0.6rem;
    background: linear-gradient(90deg, #fff7e8, transparent 85%);
}

.search-result h2 {
    margin: 0.25rem 0 0.4rem;
    font-family: var(--sonnite-font-heading);
    font-size: 1.3rem;
}

.asset-path,
.search-result-path {
    color: #675b47;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}

.search-result-path {
    display: block;
    margin: -0.1rem 0 0.65rem;
}

.search-result-ranks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.55rem;
}

.search-result-ranks span {
    padding: 0.25rem 0.5rem;
    border: 1px solid #e3ded4;
    border-radius: 999px;
    background: #faf9f6;
    color: #666;
    font-size: 0.75rem;
}

.search-result-ranks strong {
    color: #624000;
}

.search-result p {
    max-width: 50rem;
    margin: 0;
    color: #555;
    line-height: 1.55;
}

.search-prompt,
.search-empty {
    padding: 2.5rem 1rem;
    color: #666;
    text-align: center;
}

.search-empty h2 {
    margin-bottom: 0.3rem;
    color: #222;
    font-family: var(--sonnite-font-heading);
}

.search-empty p,
.search-prompt p {
    margin: 0;
}

.news-detail-page,
.news-admin-page,
.archived-news-page {
    width: min(100%, 58rem);
    margin-inline: auto;
    padding-block: 3rem 5rem;
}

.news-heading,
.news-article-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}

.news-heading {
    margin-bottom: 2.5rem;
    padding-bottom: 1.25rem;
}

.news-heading h1,
.news-article h1,
.news-article h2 {
    margin: 0;
}

.news-article h2 {
    font-family: var(--sonnite-font-heading);
    line-height: 1.12;
}

.news-heading p {
    max-width: 38rem;
    margin-block: 0.65rem 0;
    color: #555;
}

.news-heading-actions,
.news-pagination {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.news-heading-actions .secondary-button,
.news-admin-page .secondary-button,
.archived-news-page > .news-heading .secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 0.85rem;
    border-radius: 0.35rem;
    font-weight: 700;
    text-decoration: none;
}

.news-list {
    display: grid;
    gap: 3rem;
}

.news-article {
    padding-bottom: 3rem;
    border-bottom: 1px solid #d8d5cf;
}

.news-article h1 {
    max-width: 48rem;
}

.news-article h2 {
    font-size: clamp(1.65rem, 4vw, 2.5rem);
    letter-spacing: -0.025em;
}

.news-article h2 a {
    color: #1f1f1f;
    text-decoration-color: var(--sonnite-yellow);
    text-decoration-thickness: 0.14em;
    text-underline-offset: 0.14em;
}

.news-byline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-block: 0.85rem 0;
    color: #666;
    font-size: 0.92rem;
}

.news-body {
    max-width: 48rem;
    margin-top: 1.5rem;
    color: #292929;
    font-size: 1.08rem;
    line-height: 1.78;
}

.news-options {
    flex: 0 0 auto;
}

.news-options-menu {
    display: grid;
    gap: 0.65rem;
    width: 13rem;
}

.news-options-menu a,
.news-options-menu button {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

.news-options-menu a {
    padding: 0.6rem 1rem;
    border-radius: 0.35rem;
    background: #eee;
    color: #222;
    font-weight: 700;
    text-decoration: none;
}

.news-options-menu form {
    margin: 0;
}

.news-options-menu .danger-link {
    background: #b00020;
    color: white;
}

.news-archived-badge {
    display: inline-block;
    margin-bottom: 0.55rem;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: #eee;
    color: #555;
    font-family: var(--sonnite-font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.news-pagination {
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 3rem;
}

.news-pagination a,
.news-pagination span {
    min-width: 2.4rem;
    padding: 0.55rem 0.75rem;
    box-sizing: border-box;
    border-radius: 0.35rem;
    background: #eee;
    color: #222;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.news-pagination .current-page {
    background: var(--sonnite-yellow);
    color: white;
}

.news-empty {
    padding: 4rem 1.5rem;
    border: 1px dashed #bbb;
    border-radius: 0.75rem;
    text-align: center;
}

.news-empty h2,
.news-empty p {
    margin-block: 0 0.45rem;
}

.news-back-link {
    display: inline-block;
    margin-bottom: 2rem;
    color: #704900;
    font-weight: 700;
}

.news-detail-page .news-article {
    border-bottom: 0;
}

.news-editor-card,
.news-delete-card {
    max-width: 48rem;
    margin-inline: auto;
}

.news-editor-card h1,
.news-delete-card h1 {
    margin-top: 0;
}

.news-editor-form textarea {
    width: 100%;
    padding: 0.75rem;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 0.35rem;
    font: inherit;
    line-height: 1.55;
    resize: vertical;
}

.markdown-field-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.markdown-help {
    position: relative;
    flex: 0 0 auto;
}

.markdown-help > summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    box-sizing: border-box;
    border: 1px solid #bbb;
    border-radius: 50%;
    background: white;
    color: #555;
    cursor: pointer;
    list-style: none;
}

.markdown-help > summary::-webkit-details-marker {
    display: none;
}

.markdown-help > summary:hover,
.markdown-help > summary:focus-visible {
    border-color: #704900;
    color: #704900;
}

.markdown-help > summary svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: currentColor;
}

.markdown-help-panel {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    z-index: 10;
    width: min(22rem, calc(100vw - 3rem));
    padding: 0.9rem;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 0.5rem;
    background: white;
    box-shadow: 0 0.65rem 1.6rem rgb(0 0 0 / 12%);
    color: #292929;
    font-family: var(--sonnite-font-body);
    font-size: 0.88rem;
    font-weight: 400;
}

.markdown-help-panel dl {
    display: grid;
    gap: 0.4rem;
    margin: 0.65rem 0 0;
}

.markdown-help-panel dl > div {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(4rem, 1fr);
    gap: 0.75rem;
}

.markdown-help-panel dt,
.markdown-help-panel dd {
    margin: 0;
}

.markdown-help-panel code,
.markdown-body code {
    padding: 0.1em 0.3em;
    border-radius: 0.25rem;
    background: #f0f0f0;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 0.9em;
}

.markdown-body > :first-child {
    margin-top: 0;
}

.markdown-body > :last-child {
    margin-bottom: 0;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    margin-block: 1.4em 0.5em;
    line-height: 1.25;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body blockquote,
.markdown-body pre,
.markdown-body table {
    margin-block: 0 1em;
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 1.6em;
}

.markdown-body blockquote {
    padding: 0.15rem 0 0.15rem 1rem;
    border-left: 0.25rem solid var(--sonnite-yellow);
    color: #555;
}

.markdown-body blockquote > :last-child {
    margin-bottom: 0;
}

.markdown-body pre {
    max-width: 100%;
    padding: 0.9rem;
    overflow-x: auto;
    border-radius: 0.4rem;
    background: #f0f0f0;
    line-height: 1.5;
}

.markdown-body pre code {
    padding: 0;
    background: transparent;
}

.markdown-body table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

.markdown-body th,
.markdown-body td {
    padding: 0.45rem 0.65rem;
    border: 1px solid #ccc;
}

.markdown-body th {
    background: #f5f5f5;
}

.markdown-body input[type="checkbox"] {
    margin-right: 0.35rem;
}

.news-delete-card .admin-form-actions form {
    margin: 0;
}

.library-detail-page {
    width: min(100%, 72rem);
    margin-inline: auto;
    padding-block: 3rem 5rem;
}

.library-detail-heading h1 {
    margin: 0.2rem 0 0.7rem;
}

.library-detail-heading p {
    max-width: 42rem;
    margin: 0;
    color: #595959;
    line-height: 1.6;
}

.library-add-document {
    flex: 0 0 auto;
    padding: 0.8rem 1.2rem;
    font-family: var(--sonnite-font-heading);
    font-weight: 700;
}

.library-upload-dialog {
    width: min(100% - 2rem, 30rem);
    max-width: none;
    padding: 0;
    border: 0;
    border-radius: 0.7rem;
    background: transparent;
    overflow: visible;
}

.library-upload-dialog::backdrop {
    background: rgb(20 17 12 / 58%);
}

.library-upload-dialog-content {
    position: relative;
}

.library-upload-close {
    position: absolute;
    z-index: 1;
    top: 0.75rem;
    right: 0.75rem;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    color: #514a3e;
    font-size: 1.5rem;
    line-height: 1;
}

.library-upload-close:hover {
    background: #f1eadc;
}

.library-upload {
    display: grid;
    gap: 0.65rem;
    padding: 1.25rem;
    border: 1px solid #ded7ca;
    border-top: 0.35rem solid var(--sonnite-yellow);
    border-radius: 0.7rem;
    background: #fffdf8;
    box-shadow: 0 1rem 2.5rem rgb(33 26 14 / 8%);
}

.library-upload h2,
.library-collection h2,
.library-summary-card h2,
.library-facts h2 {
    margin: 0;
    font-family: var(--sonnite-font-heading);
}

.library-upload label {
    font-family: var(--sonnite-font-heading);
    font-size: 0.85rem;
    font-weight: 700;
}

.library-upload label span {
    color: #777;
    font-weight: 400;
}

.library-upload input[type="text"],
.library-upload textarea {
    min-width: 0;
    padding: 0.8rem 0.9rem;
    border: 1px solid #bbb;
    border-radius: 0.4rem;
    background: white;
    font: inherit;
}

.library-upload textarea {
    resize: vertical;
}

.library-upload .muted {
    margin: 0;
    font-size: 0.82rem;
}

.library-search .search-form {
    margin-bottom: 3.5rem;
}

.library-tabs {
    margin-bottom: 1.5rem;
}

.library-breadcrumbs {
    min-width: 0;
    color: #6a5837;
}

.library-breadcrumbs h2 {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0;
}

.library-breadcrumbs a {
    color: inherit;
    text-decoration: none;
}

.library-breadcrumbs a:hover {
    text-decoration: underline;
}

.library-folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 0.8rem;
    margin-top: 1rem;
}

.library-folder-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.15rem 0.7rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid #ddd4c5;
    border-radius: 0.55rem;
    background: #fffdf8;
    color: inherit;
    text-decoration: none;
}

.library-folder-card:hover {
    border-color: #d58a00;
    background: #fff8e9;
}

.library-folder-card > span {
    grid-row: 1 / span 2;
    color: #d58a00;
    font-size: 1.4rem;
}

.library-folder-card small {
    color: #666;
}

.library-section-heading,
.library-detail-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.library-section-heading > span {
    color: #76613a;
    font-size: 0.8rem;
    font-weight: 700;
}

.library-document-list {
    margin-top: 1rem;
    border-top: 1px solid #d8d8d8;
}

.library-document-row {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(10rem, 0.8fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 0.5rem;
    border-bottom: 1px solid #e1e1e1;
}

.library-document-main {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.library-document-main > span:last-child {
    min-width: 0;
}

.library-document-main strong,
.library-document-main small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.library-document-main strong {
    font-family: var(--sonnite-font-heading);
}

.library-document-main small,
.library-document-meta {
    color: #666;
    font-size: 0.82rem;
}

.library-file-mark {
    flex: 0 0 auto;
    padding: 0.45rem 0.35rem;
    border: 1px solid #d5ccc0;
    border-radius: 0.25rem;
    color: #8a3400;
    font-size: 0.65rem;
    font-weight: 900;
}

.library-document-meta {
    display: grid;
    gap: 0.2rem;
}

.library-document-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
}

.library-document-actions form {
    margin: 0;
}

.library-remove-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: #9c1831;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: underline;
}

.library-remove-link:hover {
    background: transparent;
    color: #701124;
}

.library-status-badge {
    display: inline-block;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    background: #eee;
    color: #444;
    font-size: 0.75rem;
    font-weight: 800;
}

.library-status-ready {
    background: #e5f4e8;
    color: #23672d;
}

.library-status-failed {
    background: #fbe7ea;
    color: #9c1831;
}

.library-status-queued,
.library-status-extracting,
.library-status-summarizing,
.library-status-indexing {
    background: #fff0d2;
    color: #714900;
}

.library-empty {
    margin-top: 1rem;
    padding: 2.5rem 1rem;
    border: 1px dashed #ccc;
    border-radius: 0.6rem;
    color: #666;
    text-align: center;
}

.library-empty h3,
.library-empty p {
    margin: 0.2rem;
}

.library-empty.compact {
    padding: 1.2rem;
}

.library-back {
    color: #704900;
    font-weight: 700;
}

.library-detail-heading {
    margin: 1.5rem 0 2rem;
    align-items: flex-start;
}

.library-document-title {
    margin: 0.2rem 0 0.7rem;
}

.library-detail-heading .library-document-title h1 {
    margin: 0;
}

.library-document-path-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.65rem;
}

.library-document-path-row .asset-path {
    margin: 0;
    color: #514632;
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.5;
}

.library-document-path-row .icon-button {
    flex: 0 0 auto;
}

.library-location-dialog {
    width: min(100% - 2rem, 32rem);
    max-width: none;
    padding: 0;
    border: 0;
    border-radius: 0.8rem;
    box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 25%);
}

.library-location-dialog::backdrop {
    background: rgb(20 18 13 / 55%);
}

.library-location-dialog-content {
    position: relative;
    padding: 1.5rem;
    background: white;
}

.library-location-form {
    display: grid;
    gap: 1rem;
}

.library-folder-picker {
    display: grid;
    min-inline-size: 0;
    gap: 0.55rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.library-folder-picker legend {
    margin-bottom: 0.15rem;
    padding: 0;
    font-family: var(--sonnite-font-heading);
    font-size: 0.85rem;
    font-weight: 700;
}

.library-location-form h2,
.library-location-selected {
    margin: 0;
}

.library-location-selected {
    color: #675b47;
    font-size: 0.9rem;
}

.library-location-selected strong {
    display: block;
    margin-top: 0.2rem;
    color: #342d21;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}

.library-location-tree {
    max-height: min(22rem, 48vh);
    padding: 0.45rem;
    overflow: auto;
    border: 1px solid #d7d0c4;
    border-radius: 0.55rem;
    background: #fffdf8;
}

.library-location-tree-level {
    margin-left: 1.05rem;
    padding-left: 0.65rem;
    border-left: 1px solid #ded7ca;
}

.library-location-tree-root,
.library-location-tree-row {
    width: 100%;
    min-height: 2.25rem;
    padding: 0.4rem 0.55rem;
    border: 0;
    border-radius: 0.4rem;
    color: #30291e;
    background: transparent;
    box-sizing: border-box;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.library-location-tree-root {
    display: grid;
    grid-template-columns: 1.1rem minmax(0, 1fr);
    gap: 0.45rem;
    align-items: center;
}

.library-location-tree-row {
    display: grid;
    grid-template-columns: 0.75rem 1.1rem minmax(0, 1fr);
    gap: 0.4rem;
    align-items: center;
    list-style: none;
}

.library-location-tree-row::-webkit-details-marker {
    display: none;
}

.library-location-tree-row::before {
    content: "›";
    color: #756b5a;
    font-size: 1.2rem;
    line-height: 1;
    transition: transform 120ms ease;
}

.library-location-tree-node[open] > .library-location-tree-row::before {
    transform: rotate(90deg);
}

.library-location-tree-root:hover,
.library-location-tree-row:hover {
    background: #f7efe0;
}

.library-location-tree-root.selected,
.library-location-tree-row.selected {
    color: #563800;
    background: #ffe8b8;
    box-shadow: inset 0 0 0 1px #d99614;
}

.library-location-folder {
    position: relative;
    width: 1rem;
    height: 0.72rem;
    border-radius: 0.12rem;
    background: #d99000;
}

.library-location-folder::before {
    position: absolute;
    top: -0.22rem;
    left: 0.08rem;
    width: 0.46rem;
    height: 0.26rem;
    border-radius: 0.12rem 0.12rem 0 0;
    background: #d99000;
    content: "";
}

.library-location-actions {
    justify-content: flex-end;
}

.library-edit-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.library-edit-heading .icon-button {
    flex: 0 0 auto;
}

.library-inline-form {
    display: grid;
    gap: 0.65rem;
    width: 100%;
}

.library-inline-form label {
    font-family: var(--sonnite-font-heading);
    font-weight: 700;
}

.library-inline-form input,
.library-inline-form textarea {
    width: 100%;
    padding: 0.8rem 0.9rem;
    box-sizing: border-box;
    border: 1px solid #bbb;
    border-radius: 0.4rem;
    background: white;
    font: inherit;
}

.library-inline-form textarea {
    line-height: 1.6;
    resize: vertical;
}

.library-inline-form .error,
.library-document-title .success,
.library-summary-card .success {
    margin: 0;
}

.library-form-actions {
    display: flex;
    gap: 0.65rem;
}

.library-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(16rem, 0.8fr);
    gap: 2rem;
}

.library-summary-card,
.library-facts,
.library-content-card {
    padding: 1.5rem;
    border: 1px solid #ddd;
    border-radius: 0.7rem;
}

.library-content-card {
    grid-column: 1 / -1;
    min-width: 0;
}

.library-content-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.library-content-heading h2 {
    margin: 0;
}

.library-content-card .markdown-body {
    overflow-wrap: anywhere;
}

.library-content-card .markdown-body pre,
.library-content-card .markdown-body table {
    max-width: 100%;
    overflow-x: auto;
}

.library-full-document-page > h1 {
    margin-bottom: 2rem;
}

.library-full-document-content {
    min-width: 0;
    overflow-wrap: anywhere;
}

.library-summary-card p {
    margin-bottom: 0;
    font-size: 1.08rem;
    line-height: 1.75;
}

.library-facts {
    background: #fafafa;
}

.library-facts dl {
    margin-block: 1rem 1.25rem;
}

.library-facts dl div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 0.55rem;
    border-bottom: 1px solid #ddd;
}

.library-facts dt {
    color: #666;
}

.library-facts dd {
    margin: 0;
    text-align: right;
}

.marketing-brochure-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.marketing-brochure-card {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 1.1rem;
    border: 1px solid #ddd;
    border-radius: 0.6rem;
    background: white;
    color: inherit;
    text-decoration: none;
}

.marketing-brochure-card:hover {
    border-color: #d58a00;
    box-shadow: 0 0.4rem 1rem rgb(33 26 14 / 7%);
}

.marketing-brochure-card > span:last-child,
.marketing-brochure-card strong,
.marketing-brochure-card small {
    display: block;
    min-width: 0;
}

.marketing-brochure-card small {
    margin-top: 0.3rem;
    color: #666;
}

.library-management {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.library-management form {
    margin: 0;
}

.library-delete-control {
    position: relative;
}

.library-delete-control summary {
    padding: 0.6rem 1rem;
    border-radius: 0.35rem;
    background: #eee;
    cursor: pointer;
    list-style: none;
}

.library-delete-control form {
    position: absolute;
    right: 0;
    z-index: 2;
    width: 15rem;
    padding: 1rem;
    border: 1px solid #d8b7bd;
    border-radius: 0.5rem;
    background: white;
    box-shadow: 0 0.75rem 2rem rgb(0 0 0 / 14%);
}

.library-delete-control form p {
    margin-top: 0;
    font-size: 0.85rem;
}

@media (max-width: 960px) {
    .navbar {
        flex-wrap: wrap;
        gap: 0.75rem 1rem;
    }

    .navbar-brand { order: 1; }
    .navbar-auth { order: 2; margin-left: auto; }
    .navbar-links { order: 3; width: 100%; justify-content: center; }

    .library-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .news-detail-page,
    .news-admin-page,
    .archived-news-page {
        padding-block: 2rem 3rem;
    }

    .news-heading,
    .news-article-header {
        align-items: stretch;
        flex-direction: column;
    }

    .news-heading-actions,
    .news-admin-page .admin-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .news-heading-actions a,
    .news-admin-page .admin-form-actions > * {
        width: 100%;
        box-sizing: border-box;
    }

    .news-options {
        align-self: flex-end;
    }

    .news-body {
        font-size: 1rem;
    }

    .profile-card-header,
    .profile-actions {
        flex-direction: column;
    }

    .profile-card-header button,
    .profile-actions button {
        width: 100%;
    }

    .authenticated-content {
        padding-inline: 1rem;
    }

    .navbar {
        padding-inline: 1rem;
    }

    .navbar-links {
        justify-content: flex-start;
        gap: 1.1rem;
        overflow-x: auto;
        padding-bottom: 0.2rem;
    }

    .navbar-links a {
        flex: 0 0 auto;
    }

    .search-input-row {
        grid-template-columns: 1fr;
    }

    .search-input-row button {
        width: 100%;
    }

    .search-filter-row {
        flex-direction: column;
        gap: 0;
    }

    .search-mode-filters {
        justify-content: flex-start;
    }

    .search-results-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .library-detail-page {
        padding-block: 2rem 3rem;
    }

    .library-add-document {
        width: 100%;
    }

    .library-document-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .library-document-meta {
        grid-column: 1;
        padding-left: 3.2rem;
    }

    .library-status {
        grid-column: 2;
        grid-row: 1 / span 2;
    }

    .library-detail-heading,
    .library-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .library-management {
        flex-direction: column;
    }

    .library-management button,
    .library-management form {
        width: 100%;
    }

    .discussion-forum-page,
    .discussion-compose-page,
    .discussion-thread-page {
        padding-block: 1.5rem 3rem;
    }

    .forum-detail-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .forum-detail-heading .button-link {
        width: 100%;
        box-sizing: border-box;
    }

    .thread-row {
        grid-template-columns: 0.8rem minmax(0, 1fr);
        gap: 0.65rem;
        padding-inline: 0.85rem;
    }

    .thread-activity {
        grid-column: 2;
    }

    .discussion-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .discussion-form-actions button,
    .discussion-form-actions a {
        width: 100%;
        box-sizing: border-box;
    }

    .discussion-post header {
        align-items: flex-start;
        gap: 0.2rem;
    }

    .discussion-post-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.2rem;
    }

    .discussion-pagination {
        justify-content: flex-start;
    }

    .discussion-thread-options-row {
        align-items: flex-start;
    }
}
