:root {
    --color-canvas: #f4f6f8;
    --color-surface: #ffffff;
    --color-surface-subtle: #f8fafc;
    --color-text: #374151;
    --color-heading: #1f2937;
    --color-muted: #64748b;
    --color-muted-soft: #8f9ead;
    --color-divider: #c9d3de;
    --color-brand: #22c55e;
    --color-brand-hover: #16a34a;
    --color-brand-strong: #16a34a;
    --color-brand-soft: #f8fafc;
    --color-sidebar: #192633;
    --color-sidebar-muted: #8f9ead;
    --color-sidebar-active: #374151;
    --color-info: #2563eb;
    --color-warning: #64748b;
    --color-warning-soft: #f8fafc;
    --color-error: #ef4444;
    --color-error-soft: #f8fafc;
    --shadow-card: 0 0.4rem 1.5rem rgba(15, 23, 42, 0.055);
    --shadow-raised: 0 1rem 3rem rgba(15, 23, 42, 0.16);
    --radius-small: 0.45rem;
    --radius-medium: 0.35rem;
    --radius-large: 0.55rem;
    --sidebar-width: 17rem;
    --topbar-height: 4.5rem;
    --page-width: 90rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

body {
    min-width: 20rem;
    margin: 0;
    color: var(--color-text);
    background: var(--color-canvas);
}

body.sidebar-is-open {
    overflow: hidden;
}

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

button {
    cursor: pointer;
}

a {
    color: inherit;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    color: var(--color-heading);
}

h1 {
    margin-bottom: 0.4rem;
    font-size: clamp(1.55rem, 4vw, 2rem);
    line-height: 1.2;
    letter-spacing: -0.025em;
}

h2 {
    margin-bottom: 0.25rem;
    font-size: 1.15rem;
}

h3 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

p {
    color: var(--color-muted);
}

:focus-visible {
    outline: 0.18rem solid var(--color-brand);
    outline-offset: 0.18rem;
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.7rem 1rem;
    color: #ffffff;
    background: var(--color-brand-strong);
    border-radius: var(--radius-small);
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 750;
    text-decoration: none;
}

.brand__mark {
    display: grid;
    width: 2.35rem;
    height: 2.35rem;
    flex: 0 0 auto;
    place-items: center;
    color: #ffffff;
    background: var(--color-brand);
    border-radius: 0.65rem;
    font-size: 1.05rem;
    font-weight: 850;
}

.brand__content {
    display: grid;
}

.brand__name {
    line-height: 1.2;
}

.brand__baseline {
    margin-top: 0.15rem;
    color: var(--color-sidebar-muted);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.button {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.1rem;
    font-weight: 700;
    text-decoration: none;
    border: 0;
    border-radius: var(--radius-small);
}

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

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

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

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

.button--compact {
    min-height: 2.3rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

.button--full {
    width: 100%;
}

.icon-button {
    display: inline-grid;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 auto;
    padding: 0;
    place-items: center;
    color: inherit;
    background: transparent;
    border: 0;
    border-radius: var(--radius-small);
}

/* Authentification */

.auth-main,
.auth-shell {
    min-height: 100vh;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(22rem, 0.85fr) minmax(32rem, 1.15fr);
}

.auth-showcase {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    overflow: hidden;
    color: #ffffff;
    background: var(--color-sidebar);
}

.auth-showcase__content {
    position: relative;
    z-index: 2;
    display: flex;
    min-height: 100%;
    flex-direction: column;
    padding: clamp(2rem, 5vw, 4.5rem);
}

.brand--auth .brand__name {
    color: #ffffff;
}

.auth-showcase__message {
    max-width: 30rem;
    margin-block: auto;
    padding-block: 4rem;
}

.auth-showcase__eyebrow {
    margin-bottom: 1rem;
    color: var(--color-brand);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.auth-showcase__title {
    margin-bottom: 1.25rem;
    color: #ffffff;
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 750;
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.auth-showcase__text {
    max-width: 32rem;
    color: #c9d3de;
    font-size: 1rem;
}

.auth-showcase__footer {
    margin-bottom: 0;
    color: var(--color-sidebar-muted);
    font-size: 0.78rem;
}

.auth-showcase__pattern {
    position: absolute;
    z-index: 1;
    right: -8rem;
    bottom: -9rem;
    width: 26rem;
    height: 26rem;
    opacity: 0.12;
    background: var(--color-brand);
    border-radius: 50%;
}

.auth-showcase__pattern::before,
.auth-showcase__pattern::after {
    position: absolute;
    content: "";
    background: rgba(255, 255, 255, 0.18);
    border-radius: 50%;
}

.auth-showcase__pattern::before {
    inset: -7rem;
}

.auth-showcase__pattern::after {
    inset: 4rem;
}

.auth-panel {
    display: grid;
    min-height: 100vh;
    padding: 2rem;
    place-items: center;
    background: var(--color-canvas);
}

.auth-panel__brand {
    display: none;
}

.auth-card {
    width: min(100%, 27rem);
}

.auth-card__header {
    margin-bottom: 2rem;
}

.auth-card h1 {
    margin-bottom: 0.6rem;
    font-size: clamp(2rem, 6vw, 2.55rem);
}

.auth-card__intro {
    margin-bottom: 0;
}

.eyebrow {
    margin-bottom: 0.5rem;
    color: var(--color-brand-strong);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.auth-form {
    display: grid;
    gap: 1.2rem;
}

.form-field {
    display: grid;
    gap: 0.45rem;
}

.form-field label {
    color: var(--color-heading);
    font-size: 0.83rem;
    font-weight: 700;
}

.form-field input {
    width: 100%;
    min-height: 3rem;
    padding: 0.7rem 0.85rem;
    color: var(--color-text);
    background: var(--color-surface);
    border: 0;
    border-radius: var(--radius-small);
}

.form-field input::placeholder {
    color: #94a3b8;
}

.form-field input:focus {
    box-shadow: 0 0 0 0.18rem rgba(34, 197, 94, 0.13);
    outline: 0;
}

.form-alert {
    margin-bottom: 1.25rem;
    padding: 0.8rem 1rem;
    border: 0;
    border-radius: var(--radius-small);
}

.form-alert--error {
    color: var(--color-error);
    background: var(--color-error-soft);
}

.auth-card__security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin: 1.5rem 0 0;
    font-size: 0.75rem;
}

.security-dot,
.environment-badge__dot,
.sidebar__status {
    width: 0.45rem;
    height: 0.45rem;
    flex: 0 0 auto;
    background: var(--color-brand);
    border-radius: 50%;
}

/* Application */

.app-layout {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    z-index: 40;
    inset: 0 auto 0 0;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    color: #ffffff;
    background: var(--color-sidebar);
}

.sidebar__header {
    display: flex;
    min-height: var(--topbar-height);
    align-items: center;
    justify-content: space-between;
    padding: 0 1.35rem;
}

.brand--sidebar .brand__name {
    color: #ffffff;
}

.sidebar__close {
    display: none;
    color: #ffffff;
    font-size: 1.8rem;
}

.sidebar__nav {
    flex: 1;
    overflow-y: auto;
    padding: 1.15rem 0.8rem;
}

.sidebar__label {
    margin: 1.15rem 0.7rem 0.55rem;
    color: var(--color-sidebar-muted);
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.sidebar__label:first-child {
    margin-top: 0;
}

.nav-item {
    display: flex;
    min-height: 2.8rem;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.7rem;
    color: #c9d3de;
    font-size: 0.86rem;
    font-weight: 650;
    text-decoration: none;
    border-radius: 0.45rem;
}

.nav-item + .nav-item {
    margin-top: 0.25rem;
}

a.nav-item:hover,
.nav-item--active {
    color: #ffffff;
    background: var(--color-sidebar-active);
}

.nav-item--active {
    color: #ffffff;
}

.nav-item--disabled {
    color: #8f9ead;
    cursor: not-allowed;
}

.nav-item__icon {
    display: grid;
    width: 1.7rem;
    height: 1.7rem;
    flex: 0 0 auto;
    place-items: center;
    color: var(--color-brand);
    background: rgba(34, 197, 94, 0.1);
    border-radius: 0.4rem;
    font-size: 0.72rem;
    font-weight: 850;
}

.nav-item__icon--wide {
    font-size: 0.6rem;
}

.nav-item__badge {
    margin-left: auto;
    color: #8f9ead;
    font-size: 0.6rem;
    font-weight: 700;
}

.sidebar__footer {
    display: flex;
    min-height: 4rem;
    align-items: center;
    gap: 0.55rem;
    padding: 0 1.5rem;
    color: var(--color-sidebar-muted);
    font-size: 0.7rem;
}

.sidebar-backdrop {
    display: none;
}

.app-frame {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}

.topbar {
    position: sticky;
    z-index: 30;
    top: 0;
    display: flex;
    min-height: var(--topbar-height);
    align-items: center;
    gap: 1rem;
    padding: 0 1.75rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 0.3rem 1.25rem rgba(15, 23, 42, 0.045);
    backdrop-filter: blur(0.75rem);
}

.topbar__menu {
    display: none;
}

.menu-icon,
.menu-icon::before,
.menu-icon::after {
    display: block;
    width: 1.25rem;
    height: 0.1rem;
    background: currentColor;
}

.menu-icon {
    position: relative;
}

.menu-icon::before,
.menu-icon::after {
    position: absolute;
    left: 0;
    content: "";
}

.menu-icon::before {
    top: -0.4rem;
}

.menu-icon::after {
    top: 0.4rem;
}

.topbar__context {
    display: grid;
}

.topbar__eyebrow {
    color: var(--color-muted);
    font-size: 0.65rem;
    font-weight: 700;
}

.topbar__title {
    color: var(--color-heading);
    font-size: 0.9rem;
    font-weight: 750;
}

.user-session {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-left: auto;
}

.user-session__avatar {
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    color: var(--color-brand-strong);
    background: var(--color-brand-soft);
    border-radius: 50%;
    font-size: 0.78rem;
    font-weight: 800;
}

.user-session__identity {
    display: grid;
}

.user-session__name {
    max-width: 12rem;
    overflow: hidden;
    color: var(--color-heading);
    font-size: 0.78rem;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-session__role {
    color: var(--color-muted);
    font-size: 0.65rem;
}

.app-main {
    width: min(100%, var(--page-width));
    margin-inline: auto;
    padding: clamp(1.25rem, 3vw, 2rem);
}

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

.page-heading p {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.55rem;
    color: var(--color-muted);
    font-size: 0.7rem;
}

.breadcrumb [aria-current="page"] {
    color: var(--color-brand-strong);
    font-weight: 700;
}

.environment-badge,
.status-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 750;
    border-radius: 999px;
}

.environment-badge {
    min-height: 2rem;
    gap: 0.45rem;
    padding: 0.3rem 0.8rem;
    color: var(--color-brand-strong);
    background: var(--color-brand-soft);
    font-size: 0.72rem;
    white-space: nowrap;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
}

.section-heading--full {
    grid-column: 1 / -1;
}

.section-heading p {
    margin-bottom: 0;
    font-size: 0.78rem;
}

.section-heading > p {
    text-align: right;
}

.hub-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.hub-card,
.status-panel {
    background: var(--color-surface);
    border: 0;
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow-card);
}

.hub-card {
    display: flex;
    min-height: 14.5rem;
    flex-direction: column;
    padding: 1.25rem;
}

.hub-card--link {
    color: inherit;
    text-decoration: none;
}

.hub-card--link:hover {
    box-shadow: 0 0.7rem 2rem rgba(15, 23, 42, 0.09);
}

.hub-card--available {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
}

.hub-card__topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.35rem;
}

.hub-card__icon {
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    color: var(--color-brand-strong);
    background: var(--color-brand-soft);
    border-radius: 0.55rem;
    font-size: 0.85rem;
    font-weight: 850;
}

.hub-card__icon--wide {
    font-size: 0.72rem;
}

.hub-card p {
    margin-bottom: 1.35rem;
    font-size: 0.8rem;
}

.hub-card__action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    color: var(--color-brand-strong);
    font-size: 0.75rem;
    font-weight: 750;
}

.hub-card__action--muted {
    color: #8f9ead;
    font-weight: 650;
}

.status-label {
    min-height: 1.65rem;
    padding: 0.2rem 0.62rem;
    font-size: 0.64rem;
    white-space: nowrap;
}

.status-label--success {
    color: var(--color-brand-strong);
    background: var(--color-brand-soft);
}

.status-label--neutral {
    color: var(--color-muted);
    background: #f3f5f8;
}

.status-panel {
    margin-top: 1.5rem;
    padding: 1.25rem;
}

.status-list {
    display: grid;
    gap: 0.6rem;
    margin-top: 1rem;
}

.status-row {
    display: flex;
    min-height: 4.4rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1rem;
    background: var(--color-surface-subtle);
    border-radius: var(--radius-small);
}

.status-row__identity {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.status-row__identity div {
    display: grid;
}

.status-row__identity strong {
    color: var(--color-heading);
    font-size: 0.8rem;
}

.status-row__identity span:last-child {
    color: var(--color-muted);
    font-size: 0.7rem;
}

.status-row__marker {
    width: 0.65rem;
    height: 0.65rem;
    flex: 0 0 auto;
    background: var(--color-muted-soft);
    border: 0;
    border-radius: 50%;
}

.status-row__marker--success {
    background: var(--color-brand);
}

/* Pages techniques existantes */

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
}

.status-summary,
.check-item {
    background: var(--color-surface);
    border: 0;
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow-card);
}

.status-summary {
    margin-block: 2rem;
    padding: 1.25rem;
}

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

.status-summary--warning {
    background: var(--color-warning-soft);
}

.check-list {
    display: grid;
    gap: 0.75rem;
}

.check-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    padding: 1.25rem;
}

.check-item__indicator {
    width: 0.75rem;
    height: 0.75rem;
    margin-top: 0.4rem;
    border-radius: 999px;
}

.check-item__indicator.is-success {
    background: var(--color-brand);
}

.check-item__indicator.is-error {
    background: var(--color-error);
}

.check-item__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

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

.error-page {
    max-width: 38rem;
}

.error-page__code {
    margin-bottom: 0.5rem;
    color: var(--color-brand);
    font-size: 4rem;
    font-weight: 850;
    line-height: 1;
}

/* Bibliothèque */

.page-heading--actions {
    align-items: flex-end;
}

.breadcrumb a {
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--color-heading);
}

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

.button--ghost:hover {
    color: var(--color-heading);
    background: var(--color-surface-subtle);
}

.notice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    background: var(--color-surface);
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow-card);
}

.notice__marker {
    width: 0.55rem;
    height: 0.55rem;
    flex: 0 0 auto;
    margin-top: 0.35rem;
    background: var(--color-brand);
    border-radius: 50%;
}

.notice--success {
    color: var(--color-brand-hover);
}

.notice--error {
    color: var(--color-error);
}

.notice--error .notice__marker {
    background: var(--color-error);
}

.notice div {
    display: grid;
    gap: 0.15rem;
}

.notice strong {
    color: var(--color-heading);
    font-size: 0.82rem;
}

.notice div span {
    font-size: 0.76rem;
}

.filter-panel {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
    padding: 1rem;
    background: var(--color-surface);
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow-card);
}

.filter-panel__search {
    grid-column: span 2;
}

.filter-panel__actions {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 0.45rem;
}

.filter-panel .form-field input,
.filter-panel .form-field select,
.document-form .form-field input,
.document-form .form-field select,
.document-form .form-field textarea {
    width: 100%;
    min-height: 2.7rem;
    padding: 0.62rem 0.75rem;
    color: var(--color-text);
    background: var(--color-canvas);
    border: 0;
    border-radius: var(--radius-small);
}

.document-form .form-field textarea {
    resize: vertical;
}

.document-form .form-field textarea[data-markdown-editor] {
    min-height: 27rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.82rem;
    line-height: 1.65;
}

.filter-panel .form-field input:focus,
.filter-panel .form-field select:focus,
.document-form .form-field input:focus,
.document-form .form-field select:focus,
.document-form .form-field textarea:focus {
    box-shadow: 0 0 0 0.18rem rgba(34, 197, 94, 0.13);
    outline: 0;
}

.filter-panel .form-field label,
.document-form .form-field label,
.project-fieldset legend {
    color: var(--color-heading);
    font-size: 0.76rem;
    font-weight: 750;
}

.empty-state {
    display: grid;
    min-height: 22rem;
    margin-top: 1.25rem;
    padding: 3rem 1.5rem;
    place-items: center;
    align-content: center;
    text-align: center;
    background: var(--color-surface);
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow-card);
}

.empty-state__icon {
    display: grid;
    width: 3.25rem;
    height: 3.25rem;
    margin-bottom: 1rem;
    place-items: center;
    color: var(--color-brand-hover);
    background: var(--color-surface-subtle);
    border-radius: var(--radius-medium);
    font-weight: 850;
}

.empty-state h2 {
    margin-bottom: 0.45rem;
}

.empty-state p {
    max-width: 32rem;
    margin-bottom: 1.4rem;
    font-size: 0.86rem;
}

.knowledge-list {
    margin-top: 1.25rem;
}

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

.list-heading h2 {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.list-heading span {
    color: var(--color-muted);
    font-size: 0.68rem;
}

.table-scroll {
    overflow-x: auto;
    background: var(--color-surface);
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow-card);
}

.data-table {
    width: 100%;
    min-width: 68rem;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    padding: 0.8rem 1rem;
    color: var(--color-muted);
    background: var(--color-surface-subtle);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.data-table td {
    padding: 0.9rem 1rem;
    color: var(--color-text);
    font-size: 0.75rem;
    vertical-align: middle;
}

.data-table tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.65);
}

.data-table tbody tr:hover {
    background: var(--color-surface-subtle);
}

.data-table td strong,
.table-subtext {
    display: block;
}

.data-table td strong {
    color: var(--color-heading);
    font-size: 0.78rem;
}

.table-subtext {
    margin-top: 0.15rem;
    color: var(--color-muted-soft);
    font-size: 0.66rem;
}

/* Éditeur de connaissance */

.document-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 23rem);
    gap: 1rem;
}

.document-form__main,
.document-form__sidebar {
    min-width: 0;
}

.document-form__sidebar {
    display: grid;
    align-content: start;
    gap: 1rem;
}

.form-section {
    padding: 1.25rem;
    background: var(--color-surface);
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow-card);
}

.form-section__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.35rem;
}

.form-section__heading h2,
.form-section__heading p {
    margin-bottom: 0;
}

.form-section .form-field + .form-field {
    margin-top: 1rem;
}

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

.field-label-row > span,
.field-help,
.field-error {
    font-size: 0.68rem;
}

.field-label-row > span,
.field-help {
    color: var(--color-muted);
}

.field-error {
    color: var(--color-error);
    font-weight: 650;
}

[aria-invalid="true"] {
    box-shadow: 0 0 0 0.12rem var(--color-error);
}

.markdown-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.45rem;
}

.markdown-toolbar button {
    min-height: 2rem;
    padding: 0.35rem 0.6rem;
    color: var(--color-muted);
    background: var(--color-canvas);
    border: 0;
    border-radius: var(--radius-small);
    font-size: 0.67rem;
    font-weight: 750;
}

.markdown-toolbar button:hover {
    color: var(--color-heading);
    background: var(--color-surface-subtle);
}

.project-fieldset {
    min-width: 0;
    margin: 1rem 0 0;
    padding: 0;
    border: 0;
}

.project-fieldset p {
    margin: 0.45rem 0 0;
    font-size: 0.72rem;
}

.checkbox-list {
    display: grid;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.checkbox-list label {
    display: flex;
    min-height: 2.35rem;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.65rem;
    background: var(--color-canvas);
    border-radius: var(--radius-small);
    font-size: 0.74rem;
    cursor: pointer;
}

.checkbox-list input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--color-brand);
}

.access-summary {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem;
    background: var(--color-surface-subtle);
    border-radius: var(--radius-small);
}

.access-summary__icon {
    display: grid;
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    place-items: center;
    color: var(--color-brand-hover);
    background: var(--color-surface);
    border-radius: var(--radius-small);
    font-size: 0.7rem;
    font-weight: 850;
}

.access-summary strong {
    color: var(--color-heading);
    font-size: 0.74rem;
}

.access-summary p {
    margin: 0.2rem 0 0;
    font-size: 0.68rem;
}

.document-form__actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
    padding-top: 0.25rem;
}

@media (max-width: 75rem) {
    .hub-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 60rem) {
    .document-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 64rem) {
    .sidebar {
        transform: translateX(-105%);
        box-shadow: var(--shadow-raised);
    }

    .sidebar-is-open .sidebar {
        transform: translateX(0);
    }

    .sidebar__close,
    .topbar__menu {
        display: inline-grid;
    }

    .sidebar-backdrop {
        position: fixed;
        z-index: 35;
        inset: 0;
        width: 100%;
        height: 100%;
        padding: 0;
        background: rgba(13, 21, 17, 0.5);
        border: 0;
        opacity: 0;
        pointer-events: none;
    }

    .sidebar-is-open .sidebar-backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .app-frame {
        margin-left: 0;
    }
}

@media (max-width: 52rem) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-showcase {
        display: none;
    }

    .auth-panel {
        align-content: center;
        padding: 1.25rem;
    }

    .auth-panel__brand {
        display: flex;
        align-items: center;
        gap: 0.7rem;
        width: min(100%, 27rem);
        margin-bottom: 3rem;
    }
}

@media (max-width: 42rem) {
    .topbar {
        padding-inline: 0.75rem;
    }

    .topbar__context,
    .user-session__identity {
        display: none;
    }

    .user-session {
        gap: 0.45rem;
    }

    .app-main {
        padding: 1rem;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 1rem;
    }

    .page-heading--actions .button {
        width: 100%;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.3rem;
    }

    .section-heading > p {
        text-align: left;
    }

    .hub-grid {
        grid-template-columns: 1fr;
    }

    .filter-panel {
        grid-template-columns: 1fr;
    }

    .filter-panel__search {
        grid-column: auto;
    }

    .filter-panel__actions {
        justify-content: stretch;
    }

    .filter-panel__actions .button {
        flex: 1;
    }

    .table-scroll {
        overflow: visible;
        background: transparent;
        box-shadow: none;
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table {
        min-width: 0;
    }

    .data-table thead {
        position: absolute;
        width: 0.0625rem;
        height: 0.0625rem;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .data-table tbody {
        display: grid;
        gap: 0.75rem;
    }

    .data-table tbody tr,
    .data-table tbody tr:nth-child(even) {
        padding: 0.8rem;
        background: var(--color-surface);
        border-radius: var(--radius-medium);
        box-shadow: var(--shadow-card);
    }

    .data-table td {
        display: grid;
        grid-template-columns: minmax(6rem, 0.7fr) minmax(0, 1.3fr);
        gap: 0.7rem;
        padding: 0.45rem 0;
    }

    .data-table td::before {
        color: var(--color-muted);
        content: attr(data-label);
        font-size: 0.65rem;
        font-weight: 750;
    }

    .data-table td:first-child {
        display: block;
        padding-bottom: 0.75rem;
    }

    .data-table td:first-child::before {
        display: none;
    }

    .document-form__actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .document-form__actions .button {
        width: 100%;
    }

    .hub-card {
        min-height: 13rem;
    }

    .status-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .status-row .status-label {
        margin-left: 1.45rem;
    }

    .page-header {
        align-items: stretch;
        flex-direction: column;
        gap: 1rem;
    }

    .check-item__heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.4rem;
    }
}

@media (max-width: 26rem) {
    .user-session__avatar {
        display: none;
    }

    .button--compact {
        padding-inline: 0.55rem;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .button,
    .skip-link,
    .sidebar,
    .sidebar-backdrop {
        transition: background-color 150ms ease, color 150ms ease, opacity 180ms ease, transform 180ms ease;
    }
}
