:root {
    --ink-950: #102a43;
    --ink-800: #243b53;
    --ink-650: #486581;
    --ink-500: #627d98;
    --blue-700: #1f4f8f;
    --blue-100: #dbe8f3;
    --coral-600: #c94632;
    --coral-500: #e45d45;
    --paper: #f4f7fa;
    --paper-deep: #e8eef3;
    --white: #ffffff;
    --success: #226b52;
    --danger: #a52c2c;
    --border: #cad7e2;
    --focus: #f0a202;
    --font-display: Georgia, "Times New Roman", serif;
    --font-body: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --shadow: 0 24px 70px rgba(16, 42, 67, 0.14);
}

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

html {
    min-width: 320px;
    background: var(--paper);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink-950);
    background: var(--paper);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

button,
input,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

button {
    cursor: pointer;
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--white);
    background: var(--ink-950);
    border-radius: 0.35rem;
    transform: translateY(-180%);
    transition: transform 180ms ease;
}

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

.editorial-brand {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    gap: 0.75rem;
    color: var(--ink-950);
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.035em;
    text-decoration: none;
}

.editorial-brand--light {
    color: var(--white);
}

.editorial-brand__mark {
    display: flex;
    width: 34px;
    height: 31px;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    border-bottom: 2px solid currentColor;
}

.editorial-brand__mark i {
    display: block;
    width: 7px;
    background: currentColor;
}

.editorial-brand__mark i:nth-child(1) { height: 22px; }
.editorial-brand__mark i:nth-child(2) { height: 27px; background: var(--coral-500); }
.editorial-brand__mark i:nth-child(3) { height: 19px; }

.editorial-kicker {
    margin: 0 0 0.85rem;
    color: var(--coral-600);
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    line-height: 1.4;
    text-transform: uppercase;
}

.login-shell {
    display: grid;
    min-height: 100vh;
}

.login-context {
    position: relative;
    display: flex;
    min-height: 310px;
    overflow: hidden;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
    color: var(--white);
    background-color: var(--ink-950);
    background-image:
        linear-gradient(rgba(219, 232, 243, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(219, 232, 243, 0.055) 1px, transparent 1px);
    background-size: 28px 28px;
}

.login-context::after {
    position: absolute;
    right: -5rem;
    bottom: -7rem;
    width: 17rem;
    height: 17rem;
    border: 1px solid rgba(228, 93, 69, 0.45);
    border-radius: 50%;
    content: "";
}

.login-context__copy {
    position: relative;
    z-index: 1;
    max-width: 630px;
    margin-top: 3rem;
}

.login-context__copy h1 {
    max-width: 580px;
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(2.15rem, 7vw, 4.9rem);
    font-weight: 500;
    letter-spacing: -0.052em;
    line-height: 1;
    text-wrap: balance;
}

.login-context__copy > p:last-child {
    max-width: 570px;
    margin: 1.35rem 0 0;
    color: #c2d2e1;
    font-size: 0.98rem;
}

.login-context .editorial-kicker {
    color: #ff9b89;
}

.folio-stack {
    position: absolute;
    right: 1.5rem;
    bottom: 1.2rem;
    z-index: 1;
    display: none;
    align-items: end;
    gap: 0.3rem;
}

.folio-stack span {
    display: flex;
    width: 44px;
    align-items: end;
    justify-content: center;
    padding-bottom: 0.85rem;
    border: 1px solid rgba(219, 232, 243, 0.32);
    color: #c2d2e1;
    font-family: var(--font-display);
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    writing-mode: vertical-rl;
}

.folio-stack span:nth-child(1) { height: 120px; }
.folio-stack span:nth-child(2) { height: 160px; border-color: rgba(228, 93, 69, 0.65); }
.folio-stack span:nth-child(3) { height: 195px; }

.login-entry {
    display: grid;
    place-items: center;
    padding: 2.5rem 1rem;
    background: var(--paper);
}

.login-card {
    width: min(100%, 470px);
}

.login-card__heading h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(2.25rem, 8vw, 3.3rem);
    font-weight: 500;
    letter-spacing: -0.045em;
    line-height: 1;
}

.login-card__heading > p:last-child {
    margin: 1rem 0 0;
    color: var(--ink-650);
}

.notice {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 0.7rem;
    margin-top: 1.5rem;
    padding: 0.9rem 1rem;
    border: 1px solid;
    border-radius: 0.45rem;
    font-size: 0.9rem;
}

.notice svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.notice strong,
.notice p {
    margin: 0;
}

.notice ul {
    margin: 0.25rem 0 0;
    padding-left: 1.2rem;
}

.notice a {
    text-underline-offset: 0.2rem;
}

.notice--error {
    color: #7f1d1d;
    background: #fff1f1;
    border-color: #eab7b7;
}

.notice--success {
    color: #174f3c;
    background: #edf8f3;
    border-color: #afd4c4;
}

.login-form {
    display: grid;
    gap: 1.2rem;
    margin-top: 1.8rem;
}

.forgot-link {
    justify-self: end;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    color: var(--blue-700);
    font-size: 0.8rem;
    font-weight: 800;
    text-underline-offset: 0.25rem;
    transition: color 180ms ease;
}

.forgot-link:hover {
    color: var(--coral-600);
}

.recovery-action {
    margin-top: 1.5rem;
    text-decoration: none;
}

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

.form-field label {
    color: var(--ink-800);
    font-size: 0.84rem;
    font-weight: 800;
}

.form-field input {
    width: 100%;
    min-height: 52px;
    padding: 0.75rem 0.9rem;
    color: var(--ink-950);
    background: var(--white);
    border: 1px solid #aebfcd;
    border-radius: 0.4rem;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.form-field input:hover {
    border-color: var(--ink-650);
}

.form-field input:focus {
    border-color: var(--blue-700);
    box-shadow: 0 0 0 3px rgba(31, 79, 143, 0.13);
    outline: 0;
}

.form-field input[aria-invalid="true"] {
    border-color: var(--danger);
}

.field-error {
    margin: 0;
    color: var(--danger);
    font-size: 0.82rem;
    font-weight: 650;
}

.thema-selector,
.thema-levels {
    display: grid;
    gap: 0.75rem;
}

.thema-levels {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.thema-level {
    display: grid;
    gap: 0.4rem;
    padding: 0.75rem;
    background: #f9fbfd;
    border: 1px solid var(--border);
    border-radius: 0.45rem;
}

.thema-level label {
    color: var(--ink-650);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.thema-selection {
    min-height: 1.25rem;
    margin: 0;
    color: var(--blue-700);
    font-size: 0.78rem;
    font-weight: 750;
}

.field-control {
    position: relative;
    min-width: 0;
}

.field-control > input,
.field-control > textarea,
.field-control--thema > .thema-selector > select {
    padding-right: 3.35rem;
}

.list-select {
    min-width: 0;
}

.list-select.is-enhanced .list-select__fallback {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.list-select__control {
    min-height: 48px;
    overflow: hidden;
    padding: 0.45rem 3.35rem 0.45rem 0.5rem;
    background: var(--white);
    border: 1px solid #aebfcd;
    border-radius: 0.4rem;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.list-select__control:focus-within {
    border-color: var(--blue-700);
    box-shadow: 0 0 0 3px rgba(31, 79, 143, 0.13);
}

.list-select__control[aria-invalid="true"] {
    border-color: var(--danger);
}

.list-select__items {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.list-select__empty {
    align-self: center;
    padding: 0.35rem 0.2rem;
    color: var(--ink-500);
    font-size: 0.78rem;
}

.list-select__item {
    display: inline-flex;
    max-width: 100%;
    min-height: 44px;
    align-items: center;
    gap: 0.35rem;
    padding-left: 0.65rem;
    color: var(--ink-800);
    background: #eef5fb;
    border: 1px solid #c5d8e8;
    border-radius: 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.list-select__item-text {
    min-width: 0;
    overflow-wrap: anywhere;
}

.list-select__item-actions {
    display: inline-flex;
    flex: 0 0 auto;
    align-self: stretch;
}

.list-select__item-action {
    display: grid;
    width: 44px;
    min-height: 44px;
    place-items: center;
    padding: 0;
    color: var(--ink-650);
    background: transparent;
    border: 0;
    border-left: 1px solid #c5d8e8;
}

.list-select__item-action:hover:not(:disabled) {
    color: var(--ink-950);
    background: #dbe8f3;
}

.list-select__item-action--remove:hover:not(:disabled) {
    color: var(--danger);
    background: #fff1f1;
}

.list-select__item-action:disabled {
    cursor: not-allowed;
    opacity: 0.32;
}

.list-select__item-action svg,
.list-select__add svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
}

.list-select__add {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.55rem;
    margin-top: 0.35rem;
    color: var(--blue-700);
    background: transparent;
    border: 1px dashed #9db7ce;
    border-radius: 0.35rem;
    font-size: 0.76rem;
    font-weight: 800;
}

.list-select__add:hover {
    color: var(--ink-950);
    background: #f4f8fb;
    border-color: var(--blue-700);
}

.list-select__status {
    min-height: 1.1rem;
    margin: 0.25rem 0 0;
    color: var(--ink-500);
    font-size: 0.68rem;
}

.chapter-builder.is-enhanced .chapter-builder__fallback {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.chapter-builder__control {
    overflow: hidden;
    background: #f7fafc;
    border: 1px solid #aebfcd;
    border-radius: 0.5rem;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.chapter-builder__control:focus-within {
    border-color: var(--blue-700);
    box-shadow: 0 0 0 3px rgba(31, 79, 143, 0.13);
}

.chapter-builder__control[aria-invalid="true"] {
    border-color: var(--danger);
}

.chapter-builder__summary,
.chapter-builder__chapter-heading {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

.chapter-builder__summary {
    padding: 0.75rem 3.35rem 0.75rem 0.85rem;
    background: var(--white);
    border-bottom: 1px solid var(--border);
}

.chapter-builder__summary p,
.chapter-builder__summary p span,
.chapter-builder__chapter-title span,
.chapter-builder__chapter-title strong {
    display: block;
}

.chapter-builder__summary p {
    margin: 0;
}

.chapter-builder__summary strong {
    color: var(--ink-950);
    font-family: var(--font-display);
    font-size: 1rem;
}

.chapter-builder__summary span,
.chapter-builder__status {
    color: var(--ink-500);
    font-size: 0.7rem;
}

.chapter-builder__add-chapter,
.chapter-builder__add-topic {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.45rem 0.7rem;
    color: var(--blue-700);
    background: var(--white);
    border: 1px dashed #8faec8;
    border-radius: 0.35rem;
    font-size: 0.75rem;
    font-weight: 800;
}

.chapter-builder__add-chapter:hover,
.chapter-builder__add-topic:hover {
    color: var(--ink-950);
    background: #eef5fb;
    border-color: var(--blue-700);
}

.chapter-builder__add-chapter svg,
.chapter-builder__add-topic svg,
.chapter-builder__action svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
}

.chapter-builder__chapter-list {
    display: grid;
    gap: 0.8rem;
    padding: 0.8rem;
}

.chapter-builder__empty {
    display: grid;
    min-height: 130px;
    place-items: center;
    padding: 1.25rem;
    color: var(--ink-500);
    background: var(--white);
    border: 1px dashed #b8c8d5;
    border-radius: 0.4rem;
    text-align: center;
}

.chapter-builder__chapter-title {
    min-width: 0;
    flex: 1 1 220px;
}

.chapter-builder__chapter-title span {
    margin-bottom: 0.12rem;
    color: var(--coral-600);
    font-size: 0.65rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.chapter-builder__chapter-title strong {
    overflow-wrap: anywhere;
    color: var(--ink-950);
    font-size: 0.82rem;
}

.chapter-builder__actions {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 0.2rem;
}

.chapter-builder__action {
    display: grid;
    width: 44px;
    min-height: 44px;
    place-items: center;
    padding: 0;
    color: var(--ink-650);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.3rem;
}

.chapter-builder__action:hover:not(:disabled) {
    color: var(--ink-950);
    background: rgba(255, 255, 255, 0.78);
    border-color: #b8c8d5;
}

.chapter-builder__action--remove:hover:not(:disabled) {
    color: var(--danger);
    background: #fff1f1;
    border-color: #eab7b7;
}

.chapter-builder__action:disabled {
    cursor: not-allowed;
    opacity: 0.3;
}

.chapter-builder__chapter {
    overflow: hidden;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 0.4rem;
}

.chapter-builder__chapter-heading {
    padding: 0.55rem 0.65rem;
    background: #fbfcfd;
    border-bottom: 1px solid var(--border);
}

.chapter-builder__topics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.6rem;
}

.chapter-builder__topic {
    display: inline-flex;
    max-width: 100%;
    min-height: 44px;
    align-items: center;
    padding-left: 0.65rem;
    color: var(--ink-800);
    background: #f3f6f8;
    border: 1px solid #d2dde6;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
}

.chapter-builder__topic > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.chapter-builder__topic-actions {
    display: inline-flex;
    flex: 0 0 auto;
    align-self: stretch;
    margin-left: 0.35rem;
}

.chapter-builder__topic-actions .chapter-builder__action {
    width: 42px;
    min-height: 42px;
    border-left: 1px solid #d2dde6;
    border-radius: 0;
}

.chapter-builder__topic-actions .chapter-builder__action:last-child {
    border-radius: 0 999px 999px 0;
}

.chapter-builder__empty-topics {
    margin: 0;
    color: var(--ink-500);
    font-size: 0.74rem;
}

.chapter-builder__add-topic {
    margin: 0 0.6rem 0.6rem;
}

.chapter-builder__status {
    min-height: 1.1rem;
    margin: 0;
    padding: 0 0.85rem 0.7rem;
}

@media (max-width: 560px) {
    .chapter-builder__summary,
    .chapter-builder__chapter-heading {
        align-items: stretch;
    }

    .chapter-builder__summary {
        padding-right: 3.35rem;
    }

    .chapter-builder__summary > button {
        width: 100%;
    }

    .chapter-builder__actions {
        width: 100%;
        justify-content: flex-end;
    }

    .chapter-builder__topics {
        display: grid;
    }

    .chapter-builder__topic {
        width: 100%;
        flex-wrap: wrap;
        justify-content: space-between;
        padding-top: 0.45rem;
    }

    .chapter-builder__topic > span:first-child {
        flex: 1 1 100%;
        padding: 0 0.55rem 0.45rem 0;
    }

    .chapter-builder__topic-actions {
        width: calc(100% + 0.65rem);
        justify-content: flex-end;
        margin-left: -0.65rem;
        border-top: 1px solid #d2dde6;
    }
}

@media (max-width: 560px) {
    .list-select__item {
        width: 100%;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .list-select__item-text {
        flex: 1 1 100%;
        padding: 0.55rem 0.55rem 0.15rem 0;
    }

    .list-select__item-actions {
        width: calc(100% + 0.65rem);
        justify-content: flex-end;
        margin-left: -0.65rem;
        border-top: 1px solid #c5d8e8;
    }

    .list-select__item-action:first-child {
        border-left: 0;
    }
}

.field-info {
    position: absolute;
    z-index: 8;
    top: 0;
    right: 0.15rem;
}

.field-info__trigger {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    padding: 0;
    color: var(--blue-700);
    background: transparent;
    border: 0;
    border-radius: 0.35rem;
    cursor: help;
    font-family: Georgia, serif;
    font-size: 0.84rem;
    font-weight: 800;
    line-height: 1;
    transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.field-info__trigger span {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    background: #eef5fb;
    border: 1px solid #b8cee2;
    border-radius: 50%;
}

.field-info__trigger:hover span,
.field-info__trigger[aria-expanded="true"] span {
    color: var(--white);
    background: var(--blue-700);
    border-color: var(--blue-700);
}

.field-info__trigger:active {
    transform: scale(0.94);
}

.field-info__trigger:focus-visible {
    outline: 3px solid rgba(31, 79, 143, 0.22);
    outline-offset: 2px;
}

.field-info__popover {
    position: absolute;
    z-index: 30;
    top: calc(100% + 0.45rem);
    right: 0;
    display: none;
    width: min(390px, calc(100vw - 2rem));
    max-height: min(32rem, 70vh);
    overflow: auto;
    padding: 0.85rem;
    color: var(--ink-800);
    background: var(--white);
    border: 1px solid #b8cee2;
    border-radius: 0.5rem;
    box-shadow: 0 16px 38px rgba(16, 42, 67, 0.18);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    visibility: hidden;
    transition: opacity 150ms ease, transform 150ms ease, visibility 150ms ease;
}

.field-info.is-flipped .field-info__popover {
    top: auto;
    bottom: calc(100% + 0.45rem);
}

.field-info:hover .field-info__popover,
.field-info.is-open .field-info__popover {
    display: block;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    visibility: visible;
}

.field-info__popover > p:not(.field-info__eyebrow) {
    margin: 0.25rem 0 0.75rem;
    font-size: 0.78rem;
    line-height: 1.5;
}

.field-info__eyebrow {
    margin: 0;
    color: var(--blue-700);
    font-size: 0.66rem;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.field-info__popover pre {
    max-height: 13rem;
    overflow: auto;
    padding: 0.65rem 0.7rem;
    margin: 0.25rem 0 0;
    color: var(--ink-800);
    background: #f6f9fc;
    border-left: 3px solid var(--coral-500);
    font-family: inherit;
    font-size: 0.75rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.field-info__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
    margin-top: 0.65rem;
}

.field-info__actions button {
    min-height: 38px;
    padding: 0.4rem 0.65rem;
    color: var(--white);
    background: var(--blue-700);
    border: 0;
    border-radius: 0.35rem;
    font-size: 0.72rem;
    font-weight: 800;
}

.field-info__actions button:hover {
    background: var(--ink-950);
}

.field-info__actions span {
    color: var(--success);
    font-size: 0.7rem;
    font-weight: 700;
}

@media (hover: none) {
    .field-info:not(.is-open) .field-info__popover {
        opacity: 0;
        pointer-events: none;
        transform: translateY(-4px);
        visibility: hidden;
    }
}

.primary-button,
.logout-button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    border-radius: 0.4rem;
    font-weight: 800;
    transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.primary-button svg,
.logout-button svg,
.back-link svg,
.admin-nav-link svg,
.admin-mobile-nav svg,
.primary-action svg,
.module-back svg,
.search-control svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.primary-button {
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.75rem 1rem;
    color: var(--white);
    background: var(--blue-700);
    border: 1px solid var(--blue-700);
}

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

.back-link {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    gap: 0.35rem;
    margin-top: 1.5rem;
    color: var(--ink-650);
    font-size: 0.87rem;
    font-weight: 750;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.25rem;
    transition: color 180ms ease;
}

.back-link:hover {
    color: var(--coral-600);
}

.admin-shell {
    min-height: 100vh;
}

.admin-header {
    position: relative;
    z-index: 10;
    display: flex;
    min-height: 82px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    background: var(--white);
    border-bottom: 1px solid var(--border);
}

.admin-header__session {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.session-person {
    display: none;
    text-align: right;
}

.session-person span {
    display: block;
}

.session-person__name {
    color: var(--ink-800);
    font-size: 0.85rem;
    font-weight: 800;
}

.session-person__role {
    color: var(--ink-500);
    font-size: 0.72rem;
}

.logout-button {
    padding: 0.65rem 0.85rem;
    color: var(--ink-800);
    background: transparent;
    border: 1px solid var(--border);
}

.logout-button:hover {
    color: var(--danger);
    background: #fff7f7;
    border-color: #d6a9a9;
}

.admin-workspace {
    min-height: calc(100vh - 82px);
}

.admin-mobile-nav {
    display: flex;
    min-height: 58px;
    overflow-x: auto;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.35rem 1rem;
    background: var(--ink-950);
    scrollbar-width: thin;
}

.admin-mobile-nav a {
    display: inline-flex;
    min-width: max-content;
    min-height: 48px;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.8rem;
    color: #b4c7d7;
    border-bottom: 3px solid transparent;
    font-size: 0.84rem;
    font-weight: 750;
    text-decoration: none;
    transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.admin-mobile-nav a[aria-current="page"] {
    color: var(--white);
    background: rgba(219, 232, 243, 0.08);
    border-bottom-color: var(--coral-500);
}

.admin-rail {
    display: none;
    padding: 2rem 1.2rem;
    color: #dbe8f3;
    background: var(--ink-950);
}

.admin-rail__label {
    margin: 0 0 1.5rem;
    color: #8fa9bf;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.admin-rail__nav {
    display: grid;
    gap: 0.35rem;
}

.admin-nav-link {
    display: flex;
    min-height: 48px;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.8rem;
    color: #b4c7d7;
    border-left: 3px solid transparent;
    font-size: 0.88rem;
    font-weight: 750;
    text-decoration: none;
    transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.admin-nav-link:hover {
    color: var(--white);
    background: rgba(219, 232, 243, 0.055);
}

.admin-nav-link[aria-current="page"] {
    color: var(--white);
    background: rgba(219, 232, 243, 0.09);
    border-left: 3px solid var(--coral-500);
}

.admin-rail__edition {
    margin: auto 0 0;
    padding-top: 3rem;
    color: #b4c7d7;
    font-family: var(--font-display);
    font-size: 1.05rem;
    line-height: 1.35;
}

.admin-rail__edition span {
    color: #7895ad;
    font-family: var(--font-body);
    font-size: 0.69rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-main {
    width: min(100%, 1180px);
    margin-inline: auto;
    padding: clamp(2.5rem, 7vw, 6rem) 1rem;
}

.admin-welcome {
    max-width: 760px;
}

.admin-welcome h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 500;
    letter-spacing: -0.055em;
    line-height: 0.98;
    text-wrap: balance;
}

.admin-welcome > p:last-child {
    max-width: 650px;
    margin: 1.35rem 0 0;
    color: var(--ink-650);
    font-size: clamp(1rem, 2vw, 1.15rem);
}

.empty-desk {
    display: grid;
    gap: 2rem;
    margin-top: clamp(3rem, 7vw, 6rem);
    padding: clamp(1.5rem, 5vw, 3rem);
    background: var(--white);
    border: 1px solid var(--border);
    box-shadow: 0 15px 45px rgba(16, 42, 67, 0.06);
}

.empty-desk__graphic {
    position: relative;
    width: 145px;
    height: 165px;
    margin: 0.6rem auto 0;
}

.sheet {
    position: absolute;
    display: block;
    width: 112px;
    height: 145px;
    background: var(--paper);
    border: 1px solid var(--border);
}

.sheet--back {
    top: 0;
    left: 26px;
    transform: rotate(5deg);
}

.sheet--front {
    bottom: 0;
    left: 5px;
    padding: 1.3rem 1rem;
    background: var(--white);
    box-shadow: 0 10px 25px rgba(16, 42, 67, 0.12);
}

.sheet--front i {
    display: block;
    height: 2px;
    margin-bottom: 0.65rem;
    background: var(--blue-100);
}

.sheet--front i:nth-child(2) { width: 75%; }
.sheet--front i:nth-child(3) { width: 88%; }

.sheet--front b {
    position: absolute;
    right: 0.9rem;
    bottom: 0.7rem;
    color: var(--coral-500);
    font-family: var(--font-display);
    font-size: 1.7rem;
}

.empty-desk__index {
    margin: 0 0 0.75rem;
    color: var(--coral-600);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.empty-desk h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 5vw, 2.55rem);
    font-weight: 500;
    letter-spacing: -0.035em;
    line-height: 1.08;
}

.empty-desk div > p:last-child {
    max-width: 650px;
    margin: 1rem 0 0;
    color: var(--ink-650);
}

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

.admin-main--module {
    padding-block: clamp(2rem, 5vw, 4.5rem);
}

.module-header {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.module-header > div {
    max-width: 750px;
}

.module-header h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(2.75rem, 8vw, 4.8rem);
    font-weight: 500;
    letter-spacing: -0.055em;
    line-height: 0.98;
}

.module-header > div > p:last-child {
    max-width: 670px;
    margin: 1rem 0 0;
    color: var(--ink-650);
}

.module-header--form {
    margin-top: 1.25rem;
}

.primary-action,
.secondary-action,
.danger-action {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.7rem 1rem;
    border-radius: 0.4rem;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.primary-action {
    color: var(--white);
    background: var(--blue-700);
    border: 1px solid var(--blue-700);
}

.primary-action:hover {
    background: var(--ink-950);
    border-color: var(--ink-950);
}

.secondary-action {
    color: var(--ink-800);
    background: var(--white);
    border: 1px solid #aebfcd;
}

.secondary-action:hover {
    color: var(--blue-700);
    border-color: var(--blue-700);
}

.danger-action {
    color: var(--white);
    background: var(--danger);
    border: 1px solid var(--danger);
}

.danger-action:hover {
    background: #7f1d1d;
    border-color: #7f1d1d;
}

.module-notice,
.form-error-summary {
    max-width: 780px;
    margin-top: 1.5rem;
}

.directory-panel {
    margin-top: 2rem;
    background: var(--white);
    border: 1px solid var(--border);
}

.directory-panel__heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.35rem 1rem;
    border-bottom: 1px solid var(--border);
}

.directory-panel__heading h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.65rem, 5vw, 2.25rem);
    font-weight: 500;
    letter-spacing: -0.035em;
    line-height: 1;
}

.directory-index {
    margin: 0 0 0.4rem;
    color: var(--coral-600);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.directory-count {
    color: var(--ink-500);
    font-size: 0.72rem;
    font-weight: 750;
    white-space: nowrap;
}

.directory-filters {
    display: grid;
    gap: 0.9rem;
    padding: 1rem;
    background: #f9fbfd;
    border-bottom: 1px solid var(--border);
}

.filter-field {
    display: grid;
    gap: 0.35rem;
}

.filter-field label,
.field-label {
    color: var(--ink-800);
    font-size: 0.76rem;
    font-weight: 800;
}

.filter-field input,
.filter-field select,
.form-field select {
    width: 100%;
    min-height: 48px;
    padding: 0.65rem 0.75rem;
    color: var(--ink-950);
    background: var(--white);
    border: 1px solid #aebfcd;
    border-radius: 0.4rem;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.filter-field input:focus,
.filter-field select:focus,
.form-field select:focus {
    border-color: var(--blue-700);
    box-shadow: 0 0 0 3px rgba(31, 79, 143, 0.13);
    outline: 0;
}

.search-control {
    position: relative;
}

.search-control svg {
    position: absolute;
    top: 50%;
    left: 0.8rem;
    width: 18px;
    height: 18px;
    color: var(--ink-500);
    transform: translateY(-50%);
}

.search-control input {
    padding-left: 2.4rem;
}

.directory-filters__clear {
    align-self: center;
    justify-self: start;
}

.text-action {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    color: var(--blue-700);
    font-size: 0.82rem;
    font-weight: 800;
    text-underline-offset: 0.22rem;
}

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

.directory-table thead {
    display: none;
}

.directory-table tbody {
    display: grid;
    gap: 0.8rem;
    padding: 0.8rem;
}

.directory-table tr {
    display: grid;
    gap: 0.8rem;
    padding: 1rem;
    border: 1px solid var(--border);
}

.directory-table td {
    display: grid;
    grid-template-columns: minmax(82px, 0.32fr) minmax(0, 0.68fr);
    gap: 0.75rem;
    align-items: start;
    padding: 0;
    border: 0;
    overflow-wrap: anywhere;
}

.directory-table td::before {
    color: var(--ink-500);
    content: attr(data-label);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.directory-table td.dt-empty {
    display: block;
    padding: 2rem 1rem;
    color: var(--ink-500);
    text-align: center;
}

.directory-table td.dt-empty::before {
    display: none;
}

.directory-table-wrap .dt-container .dt-layout-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin: 0;
    padding: 0.85rem 1rem;
}

.directory-table-wrap .dt-container .dt-layout-row:first-child {
    background: #f9fbfd;
    border-bottom: 1px solid var(--border);
}

.directory-table-wrap .dt-container .dt-layout-row:last-child {
    border-top: 1px solid var(--border);
}

.directory-table-wrap .dt-container .dt-length,
.directory-table-wrap .dt-container .dt-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    color: var(--ink-650);
    font-size: 0.76rem;
    font-weight: 750;
}

.directory-table-wrap .dt-container .dt-input {
    min-height: 44px;
    margin: 0;
    padding: 0.55rem 0.7rem;
    color: var(--ink-950);
    background: var(--white);
    border: 1px solid #aebfcd;
    border-radius: 0.4rem;
}

.directory-table-wrap .dt-container .dt-search .dt-input {
    width: min(320px, 68vw);
}

.directory-table-wrap .dt-container .dt-input:focus {
    border-color: var(--blue-700);
    box-shadow: 0 0 0 3px rgba(31, 79, 143, 0.13);
    outline: 0;
}

.directory-table-wrap .dt-container .dt-info {
    color: var(--ink-500);
    font-size: 0.74rem;
}

.directory-table-wrap .dt-container .dt-paging .dt-paging-button {
    min-width: 44px;
    min-height: 44px;
    margin: 0.1rem;
    color: var(--blue-700) !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 0.35rem;
}

.directory-table-wrap .dt-container .dt-paging .dt-paging-button:hover:not(.disabled) {
    color: var(--ink-950) !important;
    background: var(--paper-deep) !important;
    border-color: var(--border) !important;
}

.directory-table-wrap .dt-container .dt-paging .dt-paging-button.current {
    color: var(--white) !important;
    background: var(--blue-700) !important;
    border-color: var(--blue-700) !important;
}

.directory-table-wrap .dt-container .dt-paging .dt-paging-button.disabled {
    color: var(--ink-500) !important;
    cursor: not-allowed !important;
    opacity: 0.55;
}

.user-identity {
    display: flex;
    min-width: 0;
    gap: 0.7rem;
}

.user-monogram {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    color: var(--ink-950);
    background: var(--blue-100);
    border-radius: 50%;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
}

.user-identity strong,
.user-identity a,
.user-identity small {
    display: block;
}

.user-identity strong {
    color: var(--ink-800);
    font-size: 0.86rem;
}

.user-identity a {
    color: var(--blue-700);
    font-size: 0.77rem;
    text-underline-offset: 0.18rem;
}

.user-identity small,
.last-access {
    color: var(--ink-500);
    font-size: 0.7rem;
}

.role-badge,
.status-badge {
    display: inline-flex;
    width: fit-content;
    min-height: 28px;
    align-items: center;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.2;
}

.role-badge--admin { color: #7f1d1d; background: #fff1f1; }
.role-badge--manager { color: #174f3c; background: #e8f5ef; }
.role-badge--generator { color: #214a78; background: #eaf2fa; }

.status-badge {
    gap: 0.4rem;
    color: var(--ink-650);
    background: var(--paper-deep);
}

.status-badge i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.status-badge--active { color: var(--success); background: #edf8f3; }
.status-badge--inactive { color: #6b4a4a; background: #f2e8e8; }

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

.row-actions a,
.row-actions button,
.row-actions__current {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    padding: 0.4rem 0.55rem;
    color: var(--blue-700);
    background: transparent;
    border: 0;
    border-radius: 0.3rem;
    font-size: 0.72rem;
    font-weight: 800;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18rem;
    transition: color 180ms ease, background-color 180ms ease;
}

.row-actions a:hover,
.row-actions button:hover {
    color: var(--ink-950);
    background: var(--paper-deep);
}

.row-actions .row-actions__danger {
    color: var(--danger);
}

.row-actions__current {
    color: var(--ink-500);
    text-decoration: none;
}

.directory-empty {
    display: grid;
    min-height: 260px;
    place-items: center;
    align-content: center;
    padding: 2rem 1rem;
    text-align: center;
}

.directory-empty svg {
    width: 44px;
    color: var(--ink-500);
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.5;
}

.directory-empty h3 {
    margin: 0.8rem 0 0;
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-weight: 500;
}

.directory-empty p {
    margin: 0.35rem 0 0;
    color: var(--ink-650);
    font-size: 0.88rem;
}

.directory-pagination {
    padding: 0 1rem 1rem;
}

.directory-pagination ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.directory-pagination a,
.directory-pagination li.active {
    display: grid;
    min-width: 44px;
    min-height: 44px;
    place-items: center;
    padding: 0.45rem;
    border: 1px solid var(--border);
    font-size: 0.78rem;
    font-weight: 800;
    text-decoration: none;
}

.directory-pagination li.active {
    color: var(--white);
    background: var(--blue-700);
    border-color: var(--blue-700);
}

.module-back {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 0.4rem;
    color: var(--ink-650);
    font-size: 0.82rem;
    font-weight: 800;
    text-underline-offset: 0.22rem;
}

.user-form {
    display: grid;
    gap: 1.25rem;
    max-width: 900px;
    margin-top: 2rem;
}

.profile-layout {
    display: grid;
    gap: 1.5rem;
    max-width: 940px;
    margin-top: 2rem;
}

.profile-card {
    align-self: start;
    padding: 1.25rem;
    color: var(--white);
    background: var(--ink-950);
    border-top: 4px solid var(--coral-500);
}

.profile-card__label {
    margin: 0 0 0.6rem;
    color: #9db4c7;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.profile-card h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 5vw, 2.35rem);
    font-weight: 500;
    letter-spacing: -0.035em;
    line-height: 1.08;
}

.profile-card dl {
    display: grid;
    gap: 0.85rem;
    margin: 1.5rem 0 0;
}

.profile-card dl div {
    padding-top: 0.8rem;
    border-top: 1px solid rgba(219, 232, 243, 0.18);
}

.profile-card dt {
    color: #8fa9bf;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.profile-card dd {
    margin: 0.2rem 0 0;
    overflow-wrap: anywhere;
    font-size: 0.86rem;
    font-weight: 700;
}

.profile-password-form {
    margin-top: 0;
}

.profile-password-form .form-sheet__heading > span {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: var(--blue-700);
    background: var(--blue-100);
    border-radius: 50%;
}

.profile-password-form .form-sheet__heading > span svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.form-sheet {
    padding: 1.2rem 1rem;
    background: var(--white);
    border: 1px solid var(--border);
}

.form-sheet__heading {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 0.8rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--border);
}

.form-sheet__heading > span {
    color: var(--coral-600);
    font-family: var(--font-display);
    font-size: 1.1rem;
}

.form-sheet__heading h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1;
}

.form-sheet__heading p {
    margin: 0.45rem 0 0;
    color: var(--ink-650);
    font-size: 0.82rem;
}

.form-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1.2rem;
}

.form-field select[aria-invalid="true"] {
    border-color: var(--danger);
}

.field-help {
    margin: 0;
    color: var(--ink-500);
    font-size: 0.76rem;
}

.password-control {
    position: relative;
}

.password-control input {
    padding-right: 6.5rem;
}

.password-control button {
    position: absolute;
    top: 4px;
    right: 4px;
    display: inline-flex;
    min-width: 88px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.4rem 0.65rem;
    color: var(--blue-700);
    background: var(--white);
    border: 0;
    border-left: 1px solid var(--border);
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 800;
}

.password-control button:focus-visible {
    border-radius: 0.25rem;
    box-shadow: 0 0 0 3px rgba(31, 79, 143, 0.2);
    outline: 0;
}

.password-control svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.password-requirement {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    align-items: center;
    gap: 0.45rem;
    min-height: 28px;
    padding: 0.35rem 0.5rem;
    color: var(--ink-650);
    background: #f4f7f9;
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    font-size: 0.72rem;
}

.password-requirement > span:first-child {
    width: 8px;
    height: 8px;
    background: #7b8d9b;
    border-radius: 50%;
}

.password-requirement strong {
    color: var(--ink-650);
    font-size: 0.7rem;
    white-space: nowrap;
}

.password-requirement--met {
    color: #174f3c;
    background: #edf8f3;
    border-color: #afd4c4;
}

.password-requirement--met > span:first-child {
    background: var(--success);
}

.password-requirement--met strong,
.password-match--valid {
    color: #174f3c;
}

.password-match--invalid {
    color: var(--danger);
    font-weight: 700;
}

.password-change {
    border: 1px solid var(--border);
    border-radius: 0.45rem;
}

.password-change summary {
    display: flex;
    min-height: 52px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0.9rem;
    cursor: pointer;
    list-style: none;
}

.password-change summary::-webkit-details-marker {
    display: none;
}

.password-change summary span {
    display: grid;
    gap: 0.2rem;
}

.password-change summary strong {
    color: var(--ink-800);
    font-size: 0.84rem;
}

.password-change summary small {
    color: var(--ink-500);
    font-size: 0.72rem;
    font-weight: 500;
}

.password-change summary svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    fill: none;
    stroke: var(--blue-700);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    transition: transform 180ms ease;
}

.password-change[open] summary svg {
    transform: rotate(180deg);
}

.password-change summary:focus-visible {
    box-shadow: 0 0 0 3px rgba(31, 79, 143, 0.16);
    outline: 0;
}

.password-change__grid {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.document-upload {
    display: grid;
    max-width: 760px;
    gap: 1.25rem;
    margin-top: 1.5rem;
    padding: clamp(1rem, 3vw, 1.5rem);
    background: var(--white);
    border: 1px solid var(--border);
}

.document-upload__intro {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 0.9rem;
    align-items: start;
}

.document-upload__intro > svg {
    width: 44px;
    height: 44px;
    padding: 0.6rem;
    color: var(--blue-700);
    background: var(--blue-100);
    border-radius: 50%;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
}

.document-upload__intro h2,
.document-upload__intro p {
    margin: 0;
}

.document-upload__intro h2 {
    color: var(--ink-950);
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 600;
}

.document-upload__intro p {
    margin-top: 0.35rem;
    color: var(--ink-650);
    font-size: 0.84rem;
    line-height: 1.6;
}

.document-upload__current {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    color: #174f3c;
    background: #edf8f3;
    border: 1px solid #afd4c4;
    font-size: 0.8rem;
}

.document-upload__current a {
    color: var(--blue-700);
    font-weight: 800;
    text-underline-offset: 0.2rem;
}

.document-upload form {
    display: grid;
    gap: 1.25rem;
}

.row-actions .row-actions__feature {
    min-height: 48px;
    padding: 0.55rem 0.75rem;
    color: var(--blue-700);
    background: var(--blue-100);
    border-color: rgba(31, 79, 143, 0.28);
}

.row-actions__feature > span {
    display: grid;
    gap: 0.12rem;
    text-align: left;
}

.row-actions__feature strong {
    font-size: 0.77rem;
}

.row-actions__feature small {
    color: var(--ink-650);
    font-size: 0.65rem;
    font-weight: 600;
}

.document-manager-header {
    align-items: end;
}

.version-count {
    padding: 0.5rem 0.75rem;
    color: var(--blue-700);
    background: var(--blue-100);
    border: 1px solid rgba(31, 79, 143, 0.2);
    font-size: 0.75rem;
    font-weight: 800;
}

.document-manager-layout {
    display: grid;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.document-manager-layout .document-upload {
    max-width: none;
    margin-top: 0;
}

.version-history {
    padding: clamp(1rem, 3vw, 1.5rem);
    background: var(--white);
    border: 1px solid var(--border);
}

.version-history__heading h2,
.version-history__heading p,
.version-history__empty p {
    margin: 0;
}

.version-history__heading h2 {
    margin-top: 0.2rem;
    color: var(--ink-950);
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 600;
}

.version-history__empty {
    display: flex;
    gap: 0.9rem;
    align-items: center;
    margin-top: 1rem;
    padding: 1rem;
    color: var(--ink-650);
    background: var(--canvas);
    border: 1px dashed var(--border-strong);
}

.version-history__empty svg {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    fill: none;
    stroke: var(--blue-700);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.5;
}

.version-history__empty strong {
    color: var(--ink-900);
}

.version-history__empty p {
    margin-top: 0.2rem;
    font-size: 0.8rem;
}

.version-list {
    display: grid;
    gap: 0.75rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.version-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.9rem;
    align-items: center;
    padding: 0.9rem;
    border: 1px solid var(--border);
}

.version-card--latest {
    border-color: rgba(31, 79, 143, 0.42);
    box-shadow: inset 3px 0 0 var(--blue-700);
}

.version-card__number {
    display: grid;
    min-width: 72px;
    gap: 0.15rem;
    justify-items: center;
}

.version-card__number span {
    color: var(--blue-700);
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
}

.version-card__number small {
    color: #176447;
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
}

.version-card__details {
    min-width: 0;
}

.version-card__details strong,
.version-card__details p,
.version-card__details small {
    display: block;
    overflow-wrap: anywhere;
}

.version-card__details strong {
    color: var(--ink-900);
    font-size: 0.88rem;
}

.version-card__details p {
    margin: 0.25rem 0;
    color: var(--blue-700);
    font-size: 0.7rem;
    font-weight: 800;
}

.version-card__details small {
    color: var(--ink-650);
    font-size: 0.7rem;
    line-height: 1.45;
}

.version-card__download {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.75rem;
    color: var(--blue-700);
    border: 1px solid rgba(31, 79, 143, 0.3);
    font-size: 0.74rem;
    font-weight: 800;
    text-decoration: none;
}

.version-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.version-card__delete {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.75rem;
    color: var(--danger);
    border: 1px solid rgba(151, 33, 33, 0.32);
    font-size: 0.74rem;
    font-weight: 800;
    text-decoration: none;
}

.version-card__delete svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.version-card__download:hover,
.version-card__download:focus-visible {
    background: var(--blue-100);
}

.version-card__delete:hover,
.version-card__delete:focus-visible {
    background: #fff1f1;
}

.version-card__download svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.version-card__recorded {
    color: #176447;
    font-size: 0.7rem;
    font-weight: 800;
}

@media (max-width: 680px) {
    .version-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .version-card__actions {
        grid-column: 1 / -1;
        justify-content: center;
    }
}

.form-field--toggle {
    align-content: start;
}

.toggle-control {
    display: flex;
    min-height: 48px;
    align-items: center;
    gap: 0.65rem;
    color: var(--ink-800);
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 700;
}

.toggle-control input {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    padding: 0;
    opacity: 0;
}

.toggle-control > span {
    position: relative;
    width: 44px;
    height: 25px;
    flex: 0 0 auto;
    background: #9aabba;
    border-radius: 999px;
    transition: background-color 180ms ease;
}

.toggle-control > span::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 19px;
    height: 19px;
    background: var(--white);
    border-radius: 50%;
    content: "";
    transition: transform 180ms ease;
}

.toggle-control input:checked + span {
    background: var(--success);
}

.toggle-control input:checked + span::after {
    transform: translateX(19px);
}

.toggle-control input:focus-visible + span {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

.form-actions {
    display: flex;
    flex-direction: column-reverse;
    gap: 0.75rem;
    align-items: stretch;
}

.form-actions form {
    display: contents;
}

.delete-sheet {
    max-width: 720px;
    margin-top: 1.25rem;
    padding: clamp(1.5rem, 5vw, 3rem);
    background: var(--white);
    border: 1px solid #d8b5b5;
    border-top: 5px solid var(--danger);
}

.delete-sheet__mark {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    margin-bottom: 1.5rem;
    color: var(--danger);
    background: #fff1f1;
    border-radius: 50%;
}

.delete-sheet__mark svg {
    width: 28px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.delete-sheet h1 {
    max-width: 600px;
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 7vw, 3.7rem);
    font-weight: 500;
    letter-spacing: -0.05em;
    line-height: 1;
}

.delete-sheet > p:not(.editorial-kicker) {
    margin: 1.2rem 0 0;
    color: var(--ink-650);
}

.delete-summary {
    display: grid;
    gap: 0;
    margin: 1.5rem 0;
    border-block: 1px solid var(--border);
}

.delete-summary div {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 1rem;
    padding: 0.75rem 0;
}

.delete-summary div + div {
    border-top: 1px solid var(--border);
}

.delete-summary dt {
    color: var(--ink-500);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.delete-summary dd {
    margin: 0;
    color: var(--ink-800);
    font-size: 0.84rem;
    font-weight: 750;
}

@media (min-width: 560px) {
    .login-context,
    .login-entry,
    .admin-header,
    .admin-main {
        padding-inline: 2rem;
    }

    .session-person {
        display: block;
    }

    .empty-desk {
        grid-template-columns: 170px 1fr;
        align-items: center;
    }

    .module-header {
        flex-direction: row;
        align-items: end;
        justify-content: space-between;
    }

    .directory-panel__heading,
    .directory-filters,
    .form-sheet {
        padding-inline: 1.5rem;
    }

    .directory-filters {
        grid-template-columns: minmax(0, 1fr) minmax(150px, 0.4fr);
    }

    .filter-field--search {
        grid-column: 1 / -1;
    }

    .directory-filters__submit {
        align-self: end;
    }

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

    .form-field--wide {
        grid-column: 1 / -1;
    }

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

@media (min-width: 760px) {
    .directory-filters {
        grid-template-columns: minmax(240px, 1fr) minmax(155px, 0.38fr) minmax(135px, 0.3fr) auto;
        align-items: end;
    }

    .filter-field--search {
        grid-column: auto;
    }

    .directory-filters__clear {
        grid-column: 1 / -1;
        min-height: 30px;
    }
}

@media (min-width: 1180px) {

    .directory-table thead {
        display: table-header-group;
    }

    .directory-table tbody {
        display: table-row-group;
        padding: 0;
    }

    .directory-table tr {
        display: table-row;
        padding: 0;
        border: 0;
    }

    .directory-table th {
        padding: 0.8rem 0.9rem;
        color: var(--ink-500);
        background: #f9fbfd;
        border-bottom: 1px solid var(--border);
        font-size: 0.65rem;
        font-weight: 800;
        letter-spacing: 0.07em;
        text-align: left;
        text-transform: uppercase;
    }

    .directory-table td {
        display: table-cell;
        padding: 0.9rem;
        border-bottom: 1px solid var(--border);
        vertical-align: middle;
    }

    .directory-table td.dt-empty {
        display: table-cell;
    }

    .directory-table tbody tr:last-child td {
        border-bottom: 0;
    }

    .directory-table td::before {
        display: none;
    }

    .directory-table th:last-child,
    .directory-table td:last-child {
        text-align: right;
    }

    .directory-table td:last-child .row-actions {
        justify-content: flex-end;
    }
}

@media (min-width: 880px) {
    .login-shell {
        grid-template-columns: minmax(430px, 1.08fr) minmax(440px, 0.92fr);
    }

    .login-context {
        min-height: 100vh;
        padding: 2.5rem clamp(2.5rem, 6vw, 6rem);
    }

    .login-context__copy {
        margin-block: auto;
    }

    .login-entry {
        min-height: 100vh;
        padding: 3rem clamp(2.5rem, 6vw, 6rem);
    }

    .folio-stack {
        display: flex;
    }

    .admin-workspace {
        display: grid;
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .admin-mobile-nav {
        display: none;
    }

    .admin-rail {
        display: flex;
        min-height: calc(100vh - 82px);
        flex-direction: column;
    }

    .admin-main {
        padding-inline: clamp(3rem, 6vw, 6rem);
    }

    .admin-main.admin-main--module {
        padding-inline: 2rem;
    }

    .profile-layout {
        grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
        align-items: start;
    }
}

@media (min-width: 1180px) {
    .admin-header {
        padding-inline: 2.5rem;
    }

    .admin-rail {
        width: 250px;
        padding-inline: 1.7rem;
    }

    .admin-workspace {
        grid-template-columns: 250px minmax(0, 1fr);
    }
}

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

.module-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.module-header__actions svg,
.markdown-import-card svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.markdown-import-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.markdown-import-header__mark {
    display: none;
    width: 88px;
    height: 112px;
    place-items: center;
    color: var(--blue-700);
    background: #eef5fb;
    border: 1px solid #bfd2e3;
    border-radius: 0.45rem 0.45rem 1.25rem 0.45rem;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.markdown-import-layout {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.markdown-import-card,
.markdown-import-guide {
    min-width: 0;
    background: var(--white);
    border: 1px solid var(--border);
}

.markdown-import-card__heading {
    display: flex;
    gap: 0.8rem;
    padding: 1rem;
    background: #f9fbfd;
    border-bottom: 1px solid var(--border);
}

.markdown-import-card__heading > svg {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    color: var(--coral-600);
}

.markdown-import-card h2,
.markdown-import-guide h2 {
    margin: 0;
    color: var(--ink-950);
    font-family: var(--font-display);
    font-size: 1.45rem;
    line-height: 1.1;
}

.markdown-import-card__heading p,
.markdown-import-guide > p:last-child {
    margin: 0.35rem 0 0;
    color: var(--ink-650);
    font-size: 0.82rem;
}

.markdown-import-field {
    padding: 1.25rem 1rem;
}

.markdown-import-field input[type="file"] {
    width: 100%;
    min-height: 52px;
    padding: 0.55rem;
    color: var(--ink-800);
    background: var(--paper);
    border: 1px dashed #8ca8bd;
    border-radius: 0.4rem;
    cursor: pointer;
}

.markdown-import-field input[type="file"]:focus-visible {
    border-color: var(--blue-700);
    box-shadow: 0 0 0 3px rgba(31, 79, 143, 0.13);
    outline: 0;
}

.markdown-import-field__status {
    min-height: 1.3rem;
    margin: 0.55rem 0 0;
    color: var(--blue-700);
    font-size: 0.75rem;
    font-weight: 750;
}

.markdown-import-actions {
    display: flex;
    flex-direction: column-reverse;
    gap: 0.65rem;
    padding: 0.9rem 1rem;
    background: #f9fbfd;
    border-top: 1px solid var(--border);
}

.markdown-import-guide {
    padding: 1.1rem;
}

.markdown-import-guide ul {
    display: grid;
    gap: 0;
    padding: 0;
    margin: 1rem 0;
    list-style: none;
}

.markdown-import-guide li {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 0.7rem;
    padding: 0.8rem 0;
    border-top: 1px solid var(--border);
}

.markdown-import-guide li:last-child {
    border-bottom: 1px solid var(--border);
}

.markdown-import-guide li > span {
    color: var(--coral-600);
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
}

.markdown-import-guide strong,
.markdown-import-guide small {
    display: block;
}

.markdown-import-guide strong {
    color: var(--ink-800);
    font-size: 0.84rem;
}

.markdown-import-guide small {
    margin-top: 0.18rem;
    color: var(--ink-500);
    font-size: 0.73rem;
    line-height: 1.45;
}

@media (min-width: 600px) {
    .markdown-import-header__mark {
        display: grid;
    }

    .markdown-import-actions {
        flex-direction: row;
        justify-content: flex-end;
    }
}

@media (min-width: 900px) {
    .admin-main--import {
        max-width: 1180px;
    }

    .markdown-import-layout {
        grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.7fr);
        align-items: start;
    }
}

/* Operator production desk */
.admin-main--generator {
    width: min(100%, 1240px);
    padding-top: clamp(2.25rem, 5vw, 4.5rem);
}

.operator-hero {
    position: relative;
    display: grid;
    overflow: hidden;
    gap: clamp(2rem, 6vw, 5rem);
    padding: clamp(1.5rem, 5vw, 3.5rem);
    color: var(--white);
    background: var(--ink-950);
    border-bottom: 5px solid var(--coral-500);
}

.operator-hero::before {
    position: absolute;
    top: 0;
    right: 0;
    width: min(36vw, 330px);
    height: 100%;
    background-image:
        linear-gradient(rgba(219, 232, 243, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(219, 232, 243, 0.06) 1px, transparent 1px);
    background-size: 24px 24px;
    content: "";
    pointer-events: none;
}

.operator-hero__copy,
.operator-route {
    position: relative;
    z-index: 1;
}

.operator-hero h1 {
    max-width: 720px;
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(2.7rem, 8vw, 5.4rem);
    font-weight: 500;
    letter-spacing: -0.055em;
    line-height: 0.96;
    text-wrap: balance;
}

.operator-hero__copy > p:last-of-type {
    max-width: 660px;
    margin: 1.3rem 0 0;
    color: #c5d5e2;
    font-size: clamp(0.95rem, 2vw, 1.08rem);
    line-height: 1.7;
}

.operator-hero__action {
    width: fit-content;
    margin-top: 1.6rem;
    cursor: pointer;
}

.operator-route {
    align-self: end;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(219, 232, 243, 0.2);
}

.operator-route__label {
    margin: 0 0 1rem;
    color: #f1b2a6;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.operator-route ol {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.operator-route li {
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 0.8rem;
    padding: 0 0 1.25rem;
}

.operator-route li:last-child {
    padding-bottom: 0;
}

.operator-route li:first-child::after {
    position: absolute;
    top: 31px;
    bottom: 4px;
    left: 16px;
    width: 1px;
    background: rgba(219, 232, 243, 0.32);
    content: "";
}

.operator-route li > span {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: var(--white);
    background: var(--coral-500);
    font-size: 0.72rem;
    font-weight: 900;
}

.operator-route strong,
.operator-route p {
    display: block;
}

.operator-route strong {
    font-size: 0.9rem;
}

.operator-route p {
    margin: 0.25rem 0 0;
    color: #b4c7d7;
    font-size: 0.78rem;
    line-height: 1.55;
}

.operator-summary {
    display: grid;
    margin-top: 1rem;
    background: var(--white);
    border: 1px solid var(--border);
}

.operator-summary > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.15rem 1rem;
    align-items: end;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--border);
}

.operator-summary > div:last-child {
    border-bottom: 0;
}

.operator-summary span {
    color: var(--ink-650);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.operator-summary strong {
    grid-row: 1 / span 2;
    grid-column: 2;
    color: var(--ink-950);
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 500;
    line-height: 0.9;
}

.operator-summary small {
    color: var(--ink-500);
    font-size: 0.75rem;
}

.operator-projects {
    margin-top: clamp(2rem, 5vw, 3.5rem);
}

.operator-projects__heading {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.operator-projects__heading h2,
.operator-projects__heading p {
    margin: 0;
}

.operator-projects__heading h2 {
    margin-top: 0.25rem;
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 500;
    letter-spacing: -0.035em;
}

.operator-projects__heading > a {
    min-height: 44px;
    padding: 0.65rem 0;
    color: var(--blue-700);
    font-size: 0.82rem;
    font-weight: 800;
    text-underline-offset: 0.22rem;
    cursor: pointer;
}

.operator-project-list {
    display: grid;
    gap: 0.8rem;
    margin-top: 1rem;
}

.operator-project-card {
    display: grid;
    gap: 1rem;
    padding: clamp(1rem, 3vw, 1.35rem);
    background: var(--white);
    border: 1px solid var(--border);
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.operator-project-card:hover {
    border-color: #9db4c7;
    box-shadow: 0 12px 32px rgba(16, 42, 67, 0.07);
}

.operator-project-card__main {
    min-width: 0;
}

.operator-project-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.8rem;
    align-items: center;
    color: var(--ink-650);
    font-size: 0.75rem;
    font-weight: 750;
}

.operator-project-card h3 {
    margin: 0.65rem 0 0;
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 3vw, 1.7rem);
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.operator-project-card__main > p {
    margin: 0.4rem 0 0;
    color: var(--ink-650);
    font-size: 0.82rem;
}

.operator-project-card__main > small {
    display: block;
    margin-top: 0.65rem;
    color: var(--success);
    font-size: 0.75rem;
    font-weight: 800;
}

.operator-project-card__actions {
    display: grid;
    gap: 0.55rem;
}

.operator-project-card__actions > a {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    min-height: 54px;
    gap: 0.65rem;
    align-items: center;
    padding: 0.65rem 0.8rem;
    color: var(--ink-800);
    background: var(--paper);
    border: 1px solid var(--border);
    text-decoration: none;
    cursor: pointer;
    transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.operator-project-card__actions > a:hover {
    color: var(--blue-700);
    background: var(--blue-100);
    border-color: rgba(31, 79, 143, 0.35);
}

.operator-project-card__actions > .operator-project-card__upload {
    color: var(--white);
    background: var(--blue-700);
    border-color: var(--blue-700);
}

.operator-project-card__actions > .operator-project-card__upload:hover {
    color: var(--white);
    background: #173f73;
    border-color: #173f73;
}

.operator-project-card__actions svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.operator-project-card__actions span {
    display: grid;
    gap: 0.05rem;
}

.operator-project-card__actions strong {
    font-size: 0.78rem;
}

.operator-project-card__actions small {
    color: inherit;
    font-size: 0.7rem;
    opacity: 0.78;
}

.operator-projects__empty {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
    padding: 1.5rem;
    color: var(--ink-650);
    background: var(--white);
    border: 1px dashed var(--border);
}

.operator-projects__empty svg {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    fill: none;
    stroke: var(--blue-700);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.5;
}

.operator-projects__empty strong {
    color: var(--ink-900);
}

.operator-projects__empty p {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
}

@media (min-width: 600px) {
    .operator-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .operator-summary > div {
        border-right: 1px solid var(--border);
        border-bottom: 0;
    }

    .operator-summary > div:last-child {
        border-right: 0;
    }

    .operator-project-card__actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 940px) {
    .operator-hero {
        grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
        align-items: end;
    }

    .operator-project-card {
        grid-template-columns: minmax(0, 1fr) minmax(390px, 0.72fr);
        align-items: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .operator-project-card,
    .operator-project-card__actions > a {
        transition: none;
    }
}

/* Proyectos editoriales y asistente de contexto */
.project-toolbar {
    display: flex;
    min-height: 48px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.project-toolbar > div {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 0.75rem;
}

.project-toolbar h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1;
}

.project-toolbar span {
    color: var(--ink-500);
    font-size: 0.74rem;
}

.project-toolbar--wizard {
    align-items: end;
}

.project-toolbar--wizard > div {
    display: grid;
    gap: 0.15rem;
}

.project-toolbar--wizard .module-back {
    width: fit-content;
    min-height: 32px;
    font-size: 0.75rem;
}

.project-toolbar--wizard h1 {
    font-size: clamp(1.55rem, 3.4vw, 2rem);
}

.project-directory {
    margin-top: 0.75rem !important;
}

.project-empty {
    min-height: 140px;
    padding-block: 1.25rem;
}

.project-identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.75rem;
}

.project-identity > span {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    color: var(--ink-950);
    background: var(--blue-100);
    border-radius: 50%;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.project-identity strong,
.project-identity small {
    display: block;
}

.project-identity strong {
    color: var(--ink-800);
    font-size: 0.86rem;
}

.project-identity small {
    max-width: 430px;
    margin-top: 0.2rem;
    color: var(--ink-500);
    font-size: 0.7rem;
}

.project-status {
    display: inline-flex;
    width: fit-content;
    min-height: 30px;
    align-items: center;
    gap: 0.42rem;
    padding: 0.25rem 0.6rem;
    color: var(--ink-650);
    background: var(--paper-deep);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
}

.project-status i {
    width: 7px;
    height: 7px;
    background: currentColor;
    border-radius: 50%;
}

.project-status--context_ready { color: #214a78; background: #eaf2fa; }
.project-status--generating { color: #75540b; background: #fff7dc; }
.project-status--reviewing { color: #68417b; background: #f5ecf8; }
.project-status--layout { color: #8a3e2d; background: #fff0eb; }
.project-status--delivered,
.project-status--approved { color: var(--success); background: #edf8f3; }

.admin-main.admin-main--wizard {
    width: 100%;
    max-width: none;
    margin-inline: 0;
    padding-inline: clamp(1rem, 2.2vw, 2.5rem);
    padding-block: 1rem;
}

.project-wizard {
    display: grid;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 0.65rem;
    margin-top: 0.75rem;
}

.wizard-progress,
.wizard-panel {
    background: var(--white);
    border: 1px solid var(--border);
}

.wizard-progress {
    padding: 0.35rem 0.45rem;
}

.wizard-progress ol {
    display: grid;
    grid-template-columns: repeat(5, minmax(44px, 1fr));
    gap: 0.2rem;
    padding: 0;
    margin: 0;
    list-style: none;
    scrollbar-width: thin;
}

.wizard-progress button {
    display: flex;
    width: 100%;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.35rem;
    color: var(--ink-500);
    background: transparent;
    border: 0;
    border-radius: 0.35rem;
    transition: color 180ms ease, background-color 180ms ease;
}

.wizard-progress button:hover {
    color: var(--ink-950);
    background: var(--paper);
}

.wizard-progress button[aria-current="step"] {
    color: var(--blue-700);
    background: #eef5fb;
}

.wizard-progress button span {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    color: var(--white);
    background: var(--ink-500);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 800;
}

.wizard-progress button[aria-current="step"] span {
    background: var(--coral-600);
}

.wizard-progress button b {
    display: none;
    font-size: 0.68rem;
}

.wizard-progress__meter {
    height: 3px;
    overflow: hidden;
    margin-top: 0.25rem;
    background: var(--paper-deep);
}

.wizard-progress__meter i {
    display: block;
    width: 20%;
    height: 100%;
    background: var(--coral-500);
    transition: width 220ms ease;
}

.wizard-inline-alert {
    padding: 0.85rem 1rem;
    margin: 0;
    color: #7f1d1d;
    background: #fff1f1;
    border: 1px solid #eab7b7;
    font-size: 0.84rem;
    font-weight: 700;
}

.wizard-stage {
    display: grid;
    min-width: 0;
    gap: 1rem;
}

.wizard-panel {
    min-width: 0;
    padding: 0;
    margin: 0;
}

.wizard-panel__heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.8rem;
    padding: 0.8rem 1rem;
    color: var(--ink-950);
    background: #f9fbfd;
    border-bottom: 1px solid var(--border);
}

.wizard-panel__heading h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1;
}

.wizard-panel__heading > span {
    display: block;
    max-width: 650px;
    margin: 0;
    color: var(--ink-500);
    font-size: 0.76rem;
}

.wizard-fields {
    display: grid;
    min-width: 0;
    gap: 0.75rem 0.9rem;
    padding: 0.9rem 1rem;
}

.wizard-fields > .form-field,
.wizard-fields .field-control,
.wizard-fields .list-select,
.wizard-fields .thema-selector {
    max-width: 100%;
    min-width: 0;
}

.wizard-fields input,
.wizard-fields select,
.wizard-fields textarea {
    width: 100%;
    min-height: 44px;
    padding: 0.55rem 0.7rem;
    color: var(--ink-950);
    background: var(--white);
    border: 1px solid #aebfcd;
    border-radius: 0.4rem;
    scroll-margin-bottom: 2rem;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.wizard-fields textarea {
    min-height: 88px;
    resize: vertical;
    line-height: 1.55;
}

.wizard-fields .form-field--large textarea {
    min-height: 240px;
}

.wizard-fields input:focus,
.wizard-fields select:focus,
.wizard-fields textarea:focus {
    border-color: var(--blue-700);
    box-shadow: 0 0 0 3px rgba(31, 79, 143, 0.13);
    outline: 0;
}

.wizard-fields [aria-invalid="true"] {
    border-color: var(--danger);
}

.field-error {
    margin: 0;
    color: var(--danger);
    font-size: 0.75rem;
    font-weight: 700;
}

.wizard-panel__actions {
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
    padding: 0.6rem 0.9rem;
    background: #f9fbfd;
    border-top: 1px solid var(--border);
}

.wizard-panel__actions > div {
    display: flex;
    flex-direction: column-reverse;
    gap: 0.65rem;
}

.text-save-action {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem;
    color: var(--blue-700);
    background: transparent;
    border: 0;
    border-radius: 0.35rem;
    font-size: 0.8rem;
    font-weight: 800;
    transition: color 180ms ease, background-color 180ms ease;
}

.text-save-action:hover {
    color: var(--ink-950);
    background: var(--paper-deep);
}

.text-save-action svg,
.module-header .secondary-action svg,
.wizard-panel__actions .primary-action svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

@media (min-width: 660px) {
    .wizard-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wizard-panel__actions,
    .wizard-panel__actions > div {
        flex-direction: row;
        align-items: center;
    }

    .wizard-panel__actions {
        justify-content: space-between;
    }

    .wizard-progress ol {
        grid-template-columns: repeat(10, minmax(44px, 1fr));
    }
}

@media (min-width: 1100px) {
    .project-toolbar--wizard {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        padding-inline: 0.25rem;
    }

    .project-toolbar--wizard > div {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: end;
        column-gap: 1rem;
    }

    .project-toolbar--wizard .module-back {
        grid-column: 1 / -1;
    }

    .project-toolbar--wizard > div > span {
        max-width: 56ch;
        padding-bottom: 0.1rem;
    }

    .wizard-panel__heading {
        display: grid;
        grid-template-columns: minmax(220px, 0.3fr) minmax(0, 1fr);
        align-items: baseline;
        padding: 0.9rem 1.25rem;
    }

    .wizard-panel__heading > span {
        max-width: 74ch;
    }

    .wizard-fields {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        gap: 1rem;
        padding: 1.25rem;
    }

    .wizard-fields > .form-field {
        grid-column: span 6;
    }

    .wizard-fields > .form-field--span-4 {
        grid-column: span 4;
    }

    .wizard-fields > .form-field--span-6 {
        grid-column: span 6;
    }

    .wizard-fields > .form-field--span-8 {
        grid-column: span 8;
    }

    .wizard-fields > .form-field--wide {
        grid-column: 1 / -1;
    }

    .wizard-panel__actions {
        padding-inline: 1.25rem;
    }
}

@media (min-width: 1500px) {
    .admin-main.admin-main--wizard {
        padding-inline: clamp(2rem, 3vw, 4rem);
    }

    .wizard-fields {
        gap: 1.15rem 1.25rem;
        padding: 1.5rem;
    }
}

@media (min-width: 1100px) {
    .wizard-progress button {
        gap: 0.45rem;
    }

    .wizard-progress button b {
        display: inline;
    }
}

@media (min-width: 760px) {
    .directory-filters--projects {
        grid-template-columns: minmax(260px, 1fr) minmax(180px, 0.45fr) auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wizard-progress__meter i {
        transition: none;
    }
}

.admin-main.admin-main--projects {
    padding-block: 0.85rem;
}

/* Directorio editorial: patrón base de módulos de gestión */
.admin-main--directory {
    width: 100%;
    max-width: none;
    margin-inline: 0;
    padding-block: clamp(1.5rem, 3vw, 2.5rem);
}

.admin-main--directory .module-header > div {
    max-width: 880px;
}

.admin-main--directory .module-header h1 {
    font-size: clamp(2.65rem, 5vw, 4rem);
}

.admin-main--directory .directory-panel {
    margin-top: 1.5rem;
    box-shadow: 0 14px 40px rgba(16, 42, 67, 0.055);
}

.row-actions svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.row-actions a,
.row-actions button {
    gap: 0.35rem;
    text-decoration: none;
}

.row-actions form {
    display: contents;
}

.publication-status {
    display: block;
    width: fit-content;
    margin-top: 0.35rem;
    font-size: 0.72rem;
    font-weight: 750;
}

.publication-status--published {
    color: #166534;
}

.publication-status--hidden {
    color: var(--ink-500);
}

.cover-upload {
    display: grid;
    grid-template-columns: minmax(110px, 150px) minmax(0, 1fr);
    align-items: center;
    gap: 1.25rem;
    padding: 1rem;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 0.55rem;
}

.cover-upload__preview {
    display: grid;
    width: 100%;
    aspect-ratio: 2 / 3;
    place-items: center;
    overflow: hidden;
    color: var(--ink-500);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 0.4rem;
}

.cover-upload__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-upload.is-removing .cover-upload__preview {
    opacity: 0.45;
}

.cover-upload__preview--empty {
    align-content: center;
    gap: 0.5rem;
    border-style: dashed;
    font-size: 0.78rem;
    font-weight: 700;
}

.cover-upload__preview svg {
    width: 42px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
}

.cover-upload__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.cover-upload__select,
.cover-upload__remove {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.8rem;
    border-radius: 0.35rem;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 800;
}

.cover-upload__select svg,
.cover-upload__remove svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.cover-upload__remove {
    color: var(--danger);
    background: var(--white);
    border: 1px solid #e4b7b7;
}

.cover-upload__remove:hover,
.cover-upload__remove:has(input:checked) {
    background: #fff1f1;
}

.cover-upload__remove input {
    width: 16px;
    height: 16px;
    accent-color: var(--danger);
}

.cover-upload__control > input:focus-visible + .cover-upload__actions .cover-upload__select,
.cover-upload__remove:focus-within {
    outline: 3px solid rgba(42, 108, 157, 0.28);
    outline-offset: 2px;
}

.cover-upload__status {
    display: block;
    margin-top: 0.65rem;
    color: var(--ink-650);
    font-size: 0.78rem;
    font-weight: 700;
}

.cover-upload__control p {
    margin: 0.65rem 0 0;
    color: var(--ink-500);
    font-size: 0.8rem;
    line-height: 1.5;
}

@media (max-width: 560px) {
    .cover-upload {
        grid-template-columns: 1fr;
    }

    .cover-upload__preview {
        width: min(150px, 100%);
    }
}

[aria-busy="true"] {
    cursor: progress;
    opacity: 0.68;
}

/* SweetAlert2 adaptado al lenguaje visual de Libros EC */
.swal2-container {
    z-index: 1000;
    padding: 0.75rem;
}

.swal2-container.swal2-backdrop-show {
    background: rgba(9, 30, 48, 0.16);
    backdrop-filter: none;
}

.librosec-dialog {
    max-height: calc(100dvh - 1.5rem);
    padding: 0;
    overflow: auto;
    color: var(--ink-950);
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    box-shadow: 0 30px 90px rgba(5, 24, 39, 0.34);
}

.librosec-dialog__title {
    padding: 1.2rem 3.5rem 0;
    color: var(--ink-950);
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    text-align: left;
}

@media (max-width: 560px) {
    .librosec-dialog__title {
        padding: 1rem 3.25rem 0 1rem;
        font-size: 1.2rem;
    }
}

.librosec-dialog__content {
    padding: 0 1.35rem 1.35rem;
    margin: 0;
    color: var(--ink-950);
    overflow: visible;
    text-align: left;
}

.librosec-dialog .swal2-close {
    width: 48px;
    height: 48px;
    color: var(--ink-650);
    border-radius: 0.35rem;
    font-family: var(--font-body);
    transition: color 180ms ease, background-color 180ms ease;
}

.librosec-dialog .swal2-close:hover {
    color: var(--danger);
    background: #fff1f1;
}

.librosec-dialog .swal2-icon {
    margin-bottom: 0;
}

.librosec-dialog .swal2-html-container {
    line-height: 1.55;
}

.librosec-dialog__confirm,
.librosec-dialog__cancel {
    min-height: 48px;
    padding: 0.7rem 1rem;
    border-radius: 0.4rem;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 800;
}

.librosec-dialog__confirm {
    background: var(--blue-700);
}

.librosec-dialog__cancel {
    color: var(--ink-800);
    background: var(--white);
    border: 1px solid #aebfcd;
}

.user-dialog-intro {
    max-width: 680px;
    margin: 0.85rem 0 1rem;
    color: var(--ink-650);
    font-size: 0.9rem;
}

.user-form--modal {
    width: 100%;
    max-width: none;
    margin-top: 0;
}

.user-form--modal .form-sheet {
    padding: 1rem;
}

.user-form--modal .form-sheet__heading p {
    max-width: 420px;
}

.librosec-toast {
    width: min(420px, calc(100vw - 1.5rem));
    padding: 0.75rem 1rem;
    color: var(--ink-950);
    background: var(--white);
    border: 1px solid var(--border);
    border-left: 4px solid var(--success);
    border-radius: 0.45rem;
    box-shadow: 0 18px 50px rgba(16, 42, 67, 0.2);
}

.librosec-toast--error {
    border-left-color: var(--danger);
}

.librosec-toast__title {
    color: var(--ink-800);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 750;
    line-height: 1.45;
    text-align: left;
}

@media (min-width: 360px) and (max-width: 559px) {
    .admin-main--directory .directory-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-main--directory .filter-field--search,
    .admin-main--directory .directory-filters__submit,
    .admin-main--directory .directory-filters__clear {
        grid-column: 1 / -1;
    }
}

@media (min-width: 760px) {
    .admin-main--directory {
        padding-inline: clamp(1.25rem, 2.5vw, 2.5rem);
    }

    .librosec-dialog__content {
        padding-inline: 1.75rem;
        padding-bottom: 1.75rem;
    }

    .user-form--modal {
        grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
        align-items: start;
    }

    .user-form--modal .form-actions,
    .user-form--modal .form-error-summary {
        grid-column: 1 / -1;
    }

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

@media (min-width: 760px) and (max-width: 1179px) {
    .admin-main--directory .directory-table tr {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-main--directory .directory-table td:first-child,
    .admin-main--directory .directory-table td:last-child {
        grid-column: 1 / -1;
    }
}

@media (min-width: 1180px) {
    .admin-main--directory .directory-table th,
    .admin-main--directory .directory-table td {
        padding-inline: clamp(0.75rem, 1.15vw, 1.25rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .swal2-popup,
    .swal2-backdrop-show,
    .swal2-toast {
        animation: none !important;
    }

    .password-change summary svg {
        transition: none;
    }
}
