:root {
    --av-turquoise: #3cb4bb;
    --av-turquoise-dark: #16868d;
    --av-ink: #111820;
    --av-muted: #607078;
    --av-line: #dbe3e5;
    --av-paper: #ffffff;
    --av-canvas: #f3f6f6;
    --av-warm: #e9dfd1;
    --shadow-soft: 0 24px 70px rgba(16, 36, 43, 0.11);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 1024px;
    color: var(--av-ink);
    background: var(--av-canvas);
    font-family: "Source Sans 3", "Source Sans Pro", "Segoe UI", sans-serif;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 82% 12%, rgba(60, 180, 187, 0.12), transparent 28rem),
        linear-gradient(120deg, rgba(233, 223, 209, 0.38), transparent 28rem),
        var(--av-canvas);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 88px;
    padding: 0 48px;
    border-bottom: 1px solid rgba(17, 24, 32, 0.09);
    background: rgba(255, 255, 255, 0.92);
}

.brand {
    display: inline-flex;
    gap: 17px;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 45px;
    height: 40px;
}

.brand-mark img {
    display: block;
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 16px;
    letter-spacing: 0.13em;
}

.brand small {
    margin-top: 2px;
    color: var(--av-muted);
    font-size: 13px;
}

.environment {
    padding: 7px 12px;
    border: 1px solid var(--av-line);
    border-radius: 999px;
    color: var(--av-muted);
    background: var(--av-paper);
    font-size: 13px;
    font-weight: 650;
}

.status-shell {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 88px);
    padding: 48px;
}

.status-card {
    width: min(1110px, calc(100vw - 96px));
    padding: 68px 72px 62px;
    border: 1px solid rgba(17, 24, 32, 0.09);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-soft);
}

.eyebrow {
    color: var(--av-turquoise-dark);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.16em;
}

h1 {
    max-width: 740px;
    margin: 14px 0 18px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(42px, 4.3vw, 66px);
    font-weight: 500;
    letter-spacing: -0.035em;
    line-height: 1.02;
}

.lead {
    max-width: 720px;
    margin: 0;
    color: var(--av-muted);
    font-size: 19px;
    line-height: 1.6;
}

.readiness {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    margin-top: 32px;
    padding: 13px 17px;
    border: 1px solid var(--av-line);
    border-radius: 4px;
    background: #f8fafa;
}

.readiness-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #bf8b2f;
    box-shadow: 0 0 0 5px rgba(191, 139, 47, 0.13);
}

.readiness.is-ready .readiness-dot {
    background: var(--av-turquoise-dark);
    box-shadow: 0 0 0 5px rgba(60, 180, 187, 0.15);
}

.readiness strong,
.readiness small {
    display: block;
}

.readiness strong {
    font-size: 14px;
}

.readiness small {
    margin-top: 2px;
    color: var(--av-muted);
    font-size: 13px;
}

.milestones {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-top: 62px;
    padding-top: 30px;
    border-top: 1px solid var(--av-line);
}

.milestones article > span {
    color: var(--av-turquoise-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.milestones h2 {
    margin: 10px 0 7px;
    font-size: 20px;
}

.milestones p {
    margin: 0;
    color: var(--av-muted);
    font-size: 15px;
    line-height: 1.5;
}

@media (max-height: 760px) {
    .status-shell { padding-top: 28px; padding-bottom: 28px; }
    .status-card { padding-top: 45px; padding-bottom: 42px; }
    .milestones { margin-top: 38px; }
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 17px;
    border: 1px solid transparent;
    border-radius: 3px;
    font: inherit;
    font-size: 14px;
    font-weight: 750;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(60, 180, 187, 0.28);
    outline-offset: 3px;
}

.button:disabled {
    cursor: wait;
    opacity: 0.58;
}

.button-primary {
    color: #fff;
    background: var(--av-ink);
}

.button-primary:hover:not(:disabled) {
    background: var(--av-turquoise-dark);
}

.button-quiet {
    border-color: var(--av-line);
    color: var(--av-ink);
    background: var(--av-paper);
}

.button-large {
    min-height: 52px;
    margin-top: 10px;
    font-size: 15px;
}

.compact {
    max-width: 880px;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-chip {
    padding-right: 15px;
    border-right: 1px solid var(--av-line);
    font-size: 14px;
    font-weight: 700;
}

.workspace {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    min-height: calc(100vh - 88px);
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 36px 24px;
    border-right: 1px solid rgba(17, 24, 32, 0.09);
    background: rgba(255, 255, 255, 0.76);
}

.side-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 45px;
    padding: 0 14px;
    border-radius: 3px;
    color: var(--av-muted);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.side-nav a span {
    width: 20px;
    color: var(--av-turquoise-dark);
    font-size: 18px;
    text-align: center;
}

.side-nav a.is-active {
    color: var(--av-ink);
    background: rgba(60, 180, 187, 0.13);
}

.side-nav a[aria-disabled="true"] {
    cursor: default;
    opacity: 0.65;
}

.workspace-main {
    padding: 58px 64px;
}

.welcome-panel {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 40px;
    max-width: 1180px;
}

.welcome-panel h1 {
    margin-top: 12px;
    font-size: 52px;
}

.secure-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 7px;
    padding: 9px 13px;
    border: 1px solid var(--av-line);
    border-radius: 999px;
    color: var(--av-muted);
    background: var(--av-paper);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.secure-badge i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--av-turquoise-dark);
    box-shadow: 0 0 0 4px rgba(60, 180, 187, 0.14);
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    max-width: 1180px;
    margin-top: 58px;
}

.module-card {
    min-height: 250px;
    padding: 31px 30px;
    border: 1px solid var(--av-line);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.9);
}

.module-card.is-next {
    border-top: 5px solid var(--av-turquoise);
    padding-top: 27px;
}

.module-index {
    color: var(--av-turquoise-dark);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.13em;
}

.module-card h2 {
    margin: 34px 0 12px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 25px;
    font-weight: 500;
}

.module-card p {
    margin: 0;
    color: var(--av-muted);
    font-size: 15px;
    line-height: 1.6;
}

.document-type-grid {
    align-items: stretch;
}

.document-type-card {
    display: flex;
    flex-direction: column;
    min-height: 290px;
}

.document-type-card h2 {
    margin-top: 28px;
}

.document-type-card footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: auto;
    padding-top: 25px;
}

.document-type-card footer > span {
    color: var(--av-muted);
    font-size: 12px;
    font-weight: 700;
}

.auth-page {
    background: var(--av-paper);
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(470px, 0.95fr) minmax(560px, 1.05fr);
    min-height: 100vh;
}

.auth-brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    padding: 48px 58px 43px;
    color: #fff;
    background:
        radial-gradient(circle at 15% 85%, rgba(60, 180, 187, 0.35), transparent 24rem),
        linear-gradient(145deg, #0c171b 0%, #14292e 65%, #123b40 100%);
    overflow: hidden;
}

.auth-brand-panel::after {
    position: absolute;
    inset: 0 auto 0 0;
    width: min(46vw, 720px);
    pointer-events: none;
    content: "";
    opacity: 0.09;
    background: repeating-linear-gradient(72deg, transparent 0 42px, var(--av-turquoise) 43px 48px, transparent 49px 78px);
    clip-path: circle(38% at 0 84%);
}

.brand-on-dark {
    position: relative;
    z-index: 1;
    color: #fff;
}

.brand-on-dark .brand-mark img {
    border-radius: 50%;
    background: #fff;
}

.brand-on-dark small {
    color: rgba(255, 255, 255, 0.67);
}

.auth-brand-panel > div,
.auth-version {
    position: relative;
    z-index: 1;
}

.auth-brand-panel .eyebrow {
    color: var(--av-turquoise);
}

.auth-brand-panel h1 {
    max-width: 580px;
    margin: 17px 0 22px;
    font-size: clamp(46px, 4vw, 67px);
}

.auth-brand-panel p {
    max-width: 540px;
    margin: 0;
    color: rgba(255, 255, 255, 0.69);
    font-size: 18px;
    line-height: 1.65;
}

.auth-version {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    letter-spacing: 0.06em;
}

.auth-form-panel {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 50px 72px;
    background:
        radial-gradient(circle at 100% 0, rgba(60, 180, 187, 0.12), transparent 30rem),
        #fff;
}

.auth-form {
    display: flex;
    flex-direction: column;
    width: min(480px, 100%);
}

.auth-form header {
    margin-bottom: 32px;
}

.auth-form h2 {
    margin: 9px 0 8px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 39px;
    font-weight: 500;
    letter-spacing: -0.025em;
}

.auth-form header p {
    margin: 0;
    color: var(--av-muted);
    line-height: 1.55;
}

.auth-form label {
    margin: 18px 0 7px;
    font-size: 13px;
    font-weight: 800;
}

.auth-form label small {
    color: var(--av-muted);
    font-weight: 500;
}

.auth-form input {
    width: 100%;
    height: 49px;
    padding: 0 14px;
    border: 1px solid #c9d4d6;
    border-radius: 3px;
    color: var(--av-ink);
    background: #fbfcfc;
    font: inherit;
}

.auth-form input:hover {
    border-color: #9fb1b4;
}

.auth-form input:focus {
    border-color: var(--av-turquoise-dark);
    background: #fff;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-alert {
    margin: 0 0 4px;
    padding: 12px 14px;
    border-left: 4px solid #b94747;
    color: #7e2727;
    background: #fff2f2;
    font-size: 14px;
    line-height: 1.45;
}

.installer-link {
    align-self: center;
    margin-top: 20px;
    color: var(--av-turquoise-dark);
    font-size: 14px;
    font-weight: 750;
}

.accounts-main {
    max-width: 1420px;
}

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 36px;
}

.page-heading h1 {
    margin: 10px 0 9px;
    font-size: 48px;
}

.page-heading .lead {
    font-size: 17px;
}

.page-alert {
    margin-top: 30px;
}

.data-panel {
    margin-top: 40px;
    border: 1px solid var(--av-line);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 14px 45px rgba(16, 36, 43, 0.06);
}

.data-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    padding: 0 25px;
    border-bottom: 1px solid var(--av-line);
}

.data-panel-heading h2 {
    margin: 0;
    font-size: 18px;
}

.data-panel-heading span {
    color: var(--av-muted);
    font-size: 13px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th,
td {
    padding: 17px 20px;
    border-bottom: 1px solid #e8edef;
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--av-muted);
    background: #f8fafa;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

td strong,
td small {
    display: block;
}

td small {
    margin-top: 3px;
    color: var(--av-turquoise-dark);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 750;
}

.status-badge::before {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    content: "";
}

.status-badge.is-active {
    color: #126b65;
    background: #e8f7f4;
}

.status-badge.is-active::before {
    background: #289e94;
}

.status-badge.is-inactive {
    color: #687276;
    background: #eef1f2;
}

.status-badge.is-inactive::before {
    background: #889499;
}

.table-actions {
    text-align: right;
    white-space: nowrap;
}

.table-action {
    margin-left: 13px;
    padding: 0;
    border: 0;
    color: var(--av-turquoise-dark);
    background: transparent;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.table-action.is-danger {
    color: #9d3e3e;
}

.table-action:disabled {
    opacity: 0.5;
}

.account-dialog {
    width: min(510px, calc(100vw - 80px));
    padding: 0;
    border: 0;
    border-radius: 5px;
    color: var(--av-ink);
    background: var(--av-paper);
    box-shadow: 0 30px 100px rgba(3, 14, 18, 0.28);
}

.account-dialog::backdrop {
    background: rgba(8, 22, 27, 0.62);
    backdrop-filter: blur(3px);
}

.dialog-form {
    display: flex;
    flex-direction: column;
    padding: 34px 38px 30px;
}

.dialog-form header {
    margin-bottom: 18px;
}

.dialog-form h2 {
    margin: 8px 0 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 30px;
    font-weight: 500;
}

.dialog-form label {
    margin: 15px 0 7px;
    font-size: 13px;
    font-weight: 800;
}

.dialog-form label small {
    color: var(--av-muted);
    font-weight: 500;
}

.dialog-form input {
    width: 100%;
    height: 47px;
    padding: 0 13px;
    border: 1px solid #c9d4d6;
    border-radius: 3px;
    background: #fbfcfc;
    font: inherit;
}

.dialog-form footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 27px;
    padding-top: 20px;
    border-top: 1px solid var(--av-line);
}

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

@media (max-height: 760px) {
    .auth-brand-panel { padding-top: 34px; padding-bottom: 30px; }
    .auth-form-panel { padding-top: 30px; padding-bottom: 30px; }
    .auth-form header { margin-bottom: 19px; }
    .auth-form label { margin-top: 12px; }
    .auth-form h2 { font-size: 34px; }
}

/* Atelier clair — interface métier V2 */

:root {
    --av-navy: #12262d;
    --av-navy-soft: #1c343b;
    --av-aqua-50: #eff9f8;
    --av-aqua-100: #d8f0ed;
    --av-aqua-600: #14877f;
    --av-sand-50: #faf8f4;
    --av-danger: #a53a42;
    --av-danger-soft: #fff1f1;
    --av-warning: #a76a17;
    --av-warning-soft: #fff7e8;
    --av-success: #19776f;
    --av-success-soft: #eaf7f4;
    --av-focus: #087f86;
    --app-topbar-height: 76px;
    --app-sidebar-width: 232px;
}

.app-page {
    min-width: 1024px;
    background:
        radial-gradient(circle at 100% 0, rgba(60, 180, 187, 0.08), transparent 32rem),
        #f5f7f7;
}

.skip-link {
    position: fixed;
    z-index: 1000;
    top: 10px;
    left: 10px;
    padding: 10px 14px;
    color: #fff;
    background: var(--av-navy);
    transform: translateY(-150%);
}

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

.app-topbar {
    position: sticky;
    z-index: 30;
    top: 0;
    height: var(--app-topbar-height);
    padding: 0 34px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(14px);
}

.app-topbar .brand-mark {
    width: 40px;
    height: 35px;
}

.app-topbar .brand-mark img {
    width: 35px;
    height: 35px;
}

.app-topbar .brand strong {
    font-size: 14px;
}

.app-topbar .brand small {
    font-size: 12px;
}

.app-context {
    display: flex;
    align-items: center;
    gap: 13px;
}

.connection-state {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--av-muted);
    font-size: 12px;
    font-weight: 750;
}

.connection-state i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--av-success);
    box-shadow: 0 0 0 4px rgba(25, 119, 111, 0.12);
}

.button-small {
    min-height: 34px;
    padding: 0 13px;
    font-size: 12px;
}

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

.button-danger:hover:not(:disabled) {
    background: #842a31;
}

.button-icon {
    min-width: 48px;
    padding: 0 10px;
    border-left-color: rgba(255, 255, 255, 0.24);
}

.button:focus-visible,
.nav-item:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(8, 127, 134, 0.28);
    outline-offset: 2px;
}

.app-shell {
    display: grid;
    grid-template-columns: var(--app-sidebar-width) minmax(0, 1fr);
    min-height: calc(100vh - var(--app-topbar-height));
}

.app-sidebar {
    position: sticky;
    top: var(--app-topbar-height);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: calc(100vh - var(--app-topbar-height));
    border-right: 1px solid #dce3e4;
    background: rgba(250, 252, 252, 0.93);
}

.primary-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 28px 18px;
}

.nav-item {
    position: relative;
    display: grid;
    grid-template-columns: 27px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 47px;
    padding: 0 14px;
    border: 0;
    border-radius: 4px;
    color: #607078;
    background: transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 750;
    text-align: left;
    cursor: pointer;
}

.nav-item:hover {
    color: var(--av-ink);
    background: #eef4f4;
}

.nav-item.is-active {
    color: var(--av-navy);
    background: var(--av-aqua-100);
}

.nav-item.is-active::before {
    position: absolute;
    inset: 7px auto 7px -18px;
    width: 4px;
    border-radius: 0 3px 3px 0;
    background: var(--av-aqua-600);
    content: "";
}

.nav-icon {
    color: var(--av-aqua-600);
    font-size: 20px;
    font-weight: 500;
    line-height: 1;
    text-align: center;
}

.nav-count {
    min-width: 23px;
    padding: 3px 6px;
    border-radius: 999px;
    color: var(--av-navy);
    background: rgba(255, 255, 255, 0.75);
    font-size: 11px;
    text-align: center;
}

.sidebar-foot {
    padding: 22px 31px 27px;
    border-top: 1px solid #e2e8e9;
    color: var(--av-muted);
}

.sidebar-foot span,
.sidebar-foot small {
    display: block;
}

.sidebar-foot span {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.sidebar-foot small {
    margin-top: 4px;
    font-size: 11px;
}

.app-main {
    width: 100%;
    min-width: 0;
    padding: 42px 46px 80px;
}

.app-view {
    width: min(100%, 1440px);
    margin: 0 auto;
    animation: view-enter 180ms ease-out;
}

@keyframes view-enter {
    from { opacity: 0; transform: translateY(3px); }
    to { opacity: 1; transform: translateY(0); }
}

.global-alert {
    width: min(100%, 1440px);
    margin: 0 auto 24px;
    padding: 14px 17px;
    border: 1px solid #ebc7c9;
    border-left: 4px solid var(--av-danger);
    border-radius: 3px;
    color: #7b2930;
    background: var(--av-danger-soft);
    font-size: 14px;
    line-height: 1.5;
}

.view-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 36px;
    margin-bottom: 34px;
}

.view-heading h1,
.editor-header h1 {
    max-width: none;
    margin: 8px 0 9px;
    color: var(--av-navy);
    font-size: 43px;
    line-height: 1.08;
}

.view-heading p,
.editor-header p {
    max-width: 760px;
    margin: 0;
    color: var(--av-muted);
    font-size: 16px;
    line-height: 1.55;
}

.heading-aside {
    min-width: 190px;
    padding: 13px 0 13px 24px;
    border-left: 1px solid var(--av-line);
}

.heading-aside span,
.heading-aside strong {
    display: block;
}

.heading-aside .quiet-label {
    margin-bottom: 5px;
    color: var(--av-muted);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.heading-aside strong {
    font-size: 14px;
}

.document-type-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.document-choice {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 283px;
    padding: 27px 27px 24px;
    border: 1px solid #d7e0e1;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 35px rgba(18, 38, 45, 0.035);
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.document-choice:hover,
.document-choice:focus-within {
    border-color: #9ecbca;
    box-shadow: 0 18px 42px rgba(18, 38, 45, 0.09);
    transform: translateY(-2px);
}

.document-choice.is-featured {
    border-top: 4px solid var(--av-turquoise);
    padding-top: 24px;
}

.document-choice-index {
    color: var(--av-aqua-600);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 13px;
    font-weight: 700;
}

.document-choice h2 {
    min-height: 60px;
    margin: 21px 0 10px;
    color: var(--av-navy);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 24px;
    font-weight: 500;
    line-height: 1.22;
}

.document-choice p {
    margin: 0;
    color: var(--av-muted);
    font-size: 14px;
    line-height: 1.55;
}

.document-choice-meta {
    margin-top: auto;
    padding-top: 20px;
    color: #79878d;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.document-choice-action {
    align-self: flex-start;
    margin-top: 15px;
    padding: 0;
    border: 0;
    color: var(--av-aqua-600);
    background: transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.document-choice-action::after {
    margin-left: 7px;
    content: "→";
}

.skeleton-card {
    min-height: 283px;
    border: 1px solid #e2e8e8;
    border-radius: 5px;
    background: linear-gradient(100deg, #f7f9f9 25%, #fff 42%, #f7f9f9 60%);
    background-size: 300% 100%;
    animation: skeleton 1.4s infinite;
}

@keyframes skeleton {
    from { background-position: 100% 0; }
    to { background-position: 0 0; }
}

.editor {
    margin: -9px auto 0;
}

.editor-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--av-line);
}

.editor-header h1 {
    margin-top: 6px;
    font-size: 38px;
}

.back-button {
    display: block;
    margin: 0 0 20px;
    padding: 0;
    border: 0;
    color: var(--av-aqua-600);
    background: transparent;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.save-state {
    display: grid;
    grid-template-columns: 11px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-width: 245px;
    padding: 12px 15px;
    border: 1px solid var(--av-line);
    border-radius: 4px;
    background: #fff;
}

.save-state-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #89969a;
}

.save-state strong,
.save-state small {
    display: block;
}

.save-state strong {
    font-size: 12px;
}

.save-state small {
    margin-top: 2px;
    color: var(--av-muted);
    font-size: 11px;
}

.save-state.is-saved .save-state-dot { background: var(--av-success); box-shadow: 0 0 0 4px rgba(25, 119, 111, 0.1); }
.save-state.is-saving .save-state-dot { background: var(--av-turquoise); animation: pulse 900ms infinite alternate; }
.save-state.is-dirty .save-state-dot { background: var(--av-warning); }
.save-state.is-error .save-state-dot,
.save-state.is-conflict .save-state-dot { background: var(--av-danger); }

@keyframes pulse { to { opacity: 0.35; } }

.editor-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 17px 19px;
    border: 1px solid var(--av-line);
    border-top: 0;
    border-radius: 0 0 4px 4px;
    background: rgba(255, 255, 255, 0.82);
}

.editor-toolbar label {
    display: grid;
    gap: 5px;
    min-width: 230px;
    color: var(--av-muted);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.editor-toolbar select {
    height: 37px;
    padding: 0 34px 0 10px;
    border: 1px solid #cad5d7;
    border-radius: 3px;
    color: var(--av-ink);
    background: #fff;
    font: inherit;
    font-size: 13px;
    text-transform: none;
}

.revision-label {
    margin-left: auto;
    padding: 0 5px 10px;
    color: var(--av-muted);
    font-size: 11px;
    font-weight: 750;
}

.editor-columns {
    display: grid;
    grid-template-columns: minmax(500px, 1.18fr) minmax(390px, 0.82fr);
    gap: 24px;
    align-items: start;
    margin-top: 25px;
}

.structured-editor {
    min-width: 0;
}

.form-section {
    margin: 0 0 18px;
    padding: 0 22px 24px;
    border: 1px solid #dbe3e4;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.96);
}

.form-section legend {
    display: flex;
    align-items: center;
    gap: 11px;
    max-width: calc(100% - 20px);
    padding: 0 9px 0 0;
    color: var(--av-navy);
}

.form-section legend span {
    display: inline-grid;
    place-items: center;
    width: 29px;
    height: 29px;
    border-radius: 50%;
    color: var(--av-aqua-600);
    background: var(--av-aqua-100);
    font-size: 10px;
    font-weight: 850;
}

.form-section legend strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    font-weight: 500;
}

.section-description {
    margin: 5px 0 18px 41px;
    color: var(--av-muted);
    font-size: 12px;
    line-height: 1.45;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 17px 14px;
    padding-top: 19px;
}

.section-description + .field-grid {
    padding-top: 0;
}

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

.field-control.width-full { grid-column: span 12; }
.field-control.width-half { grid-column: span 6; }
.field-control.width-third { grid-column: span 4; }
.field-control.width-quarter { grid-column: span 3; }

.field-control > label,
.settings-form label,
.dialog-grid label,
.reason-dialog label {
    display: block;
    margin-bottom: 6px;
    color: #33474e;
    font-size: 12px;
    font-weight: 800;
}

.required-mark {
    color: #7b898e;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.field-input-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
}

.field-control input,
.field-control select,
.field-control textarea,
.settings-form input,
.dialog-grid input,
.archive-filters input,
.archive-filters select,
.filter-bar input,
.filter-bar select,
.reason-dialog textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid #c8d3d5;
    border-radius: 3px;
    color: var(--av-ink);
    background: #fbfcfc;
    font: inherit;
    font-size: 14px;
    transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.field-control input,
.field-control select,
.settings-form input,
.dialog-grid input,
.archive-filters input,
.archive-filters select,
.filter-bar input,
.filter-bar select {
    height: 43px;
    padding: 0 11px;
}

.field-control textarea,
.reason-dialog textarea {
    min-height: 85px;
    padding: 10px 11px;
    line-height: 1.5;
    resize: vertical;
}

.field-control input:hover,
.field-control select:hover,
.field-control textarea:hover,
.settings-form input:hover,
.archive-filters input:hover,
.filter-bar input:hover {
    border-color: #9dafb2;
}

.field-control input:focus,
.field-control select:focus,
.field-control textarea:focus,
.settings-form input:focus,
.dialog-grid input:focus,
.archive-filters input:focus,
.archive-filters select:focus,
.filter-bar input:focus,
.filter-bar select:focus,
.reason-dialog textarea:focus {
    border-color: var(--av-focus);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(8, 127, 134, 0.08);
    outline: 0;
}

.field-unit {
    display: grid;
    place-items: center;
    min-width: 47px;
    margin-left: -1px;
    padding: 0 8px;
    border: 1px solid #c8d3d5;
    border-radius: 0 3px 3px 0;
    color: var(--av-muted);
    background: #f0f4f4;
    font-size: 11px;
    font-weight: 700;
}

.field-input-wrap .field-unit + input,
.field-input-wrap:has(.field-unit) input {
    border-radius: 3px 0 0 3px;
}

.field-help,
.field-error {
    display: block;
    margin-top: 5px;
    font-size: 11px;
    line-height: 1.35;
}

.field-help { color: var(--av-muted); }
.field-error { color: var(--av-danger); font-weight: 700; }

.field-control.has-error input,
.field-control.has-error select,
.field-control.has-error textarea {
    border-color: var(--av-danger);
    background: #fffafa;
}

.text-workbench {
    position: sticky;
    top: calc(var(--app-topbar-height) + 20px);
    padding: 23px;
    border: 1px solid #d3dedf;
    border-top: 4px solid var(--av-turquoise);
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 19px 52px rgba(18, 38, 45, 0.08);
}

.text-workbench-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 15px;
}

.text-workbench-heading h2 {
    margin: 4px 0 0;
    color: var(--av-navy);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 27px;
    font-weight: 500;
}

.text-action {
    max-width: 145px;
    padding: 0;
    border: 0;
    color: var(--av-aqua-600);
    background: transparent;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.35;
    text-align: right;
    cursor: pointer;
}

#final-text {
    display: block;
    width: 100%;
    min-height: 410px;
    padding: 18px 19px;
    border: 1px solid #c7d3d4;
    border-radius: 3px;
    color: #18282e;
    background:
        linear-gradient(to bottom, transparent 31px, rgba(215, 224, 225, 0.5) 32px),
        #fff;
    background-size: 100% 32px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 15px;
    line-height: 2.13;
    resize: vertical;
}

.textarea-foot {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 7px;
    color: var(--av-muted);
    font-size: 10px;
}

.editor-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 19px;
    padding-top: 17px;
    border-top: 1px solid var(--av-line);
}

.archive-actions {
    display: grid;
    grid-column: span 2;
    grid-template-columns: minmax(0, 1fr) auto;
}

.archive-actions .button:first-child {
    border-radius: 3px 0 0 3px;
}

.archive-actions .button:last-child {
    border-radius: 0 3px 3px 0;
}

.filter-bar,
.archive-filters {
    display: flex;
    align-items: flex-end;
    gap: 13px;
    margin-bottom: 22px;
    padding: 17px 19px;
    border: 1px solid var(--av-line);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.92);
}

.filter-bar label,
.archive-filters label {
    display: grid;
    gap: 5px;
    min-width: 160px;
    color: var(--av-muted);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.filter-bar .search-field {
    flex: 1;
    min-width: 260px;
}

.archive-filters {
    display: grid;
    grid-template-columns: 1.35fr repeat(6, minmax(125px, 0.8fr)) auto;
}

.archive-filters label {
    min-width: 0;
}

.archive-filters .wide {
    grid-column: span 2;
}

.filter-actions {
    display: flex;
    gap: 8px;
}

.app-data-panel {
    margin-top: 0;
    overflow: hidden;
}

.app-data-panel tbody tr {
    transition: background 100ms ease;
}

.app-data-panel tbody tr:hover {
    background: #fbfdfd;
}

.app-data-panel td {
    height: 67px;
}

.app-data-panel .table-action {
    display: inline-block;
    text-decoration: none;
}

.table-message {
    height: 120px !important;
    color: var(--av-muted);
    text-align: center;
}

.empty-state {
    padding: 54px 25px;
    color: var(--av-muted);
    text-align: center;
}

.empty-state.standalone {
    grid-column: 1 / -1;
    border: 1px solid var(--av-line);
    border-radius: 4px;
    background: #fff;
}

.empty-state strong {
    display: block;
    color: var(--av-navy);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 22px;
    font-weight: 500;
}

.empty-state p {
    margin: 7px 0 0;
    font-size: 13px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    min-height: 62px;
    border-top: 1px solid var(--av-line);
    color: var(--av-muted);
    font-size: 12px;
}

.pagination-button {
    padding: 7px 11px;
    border: 1px solid var(--av-line);
    border-radius: 3px;
    color: var(--av-ink);
    background: #fff;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
}

.pagination-button:disabled {
    cursor: default;
    opacity: 0.45;
}

.settings-tabs {
    display: flex;
    gap: 25px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--av-line);
}

.settings-tabs button {
    position: relative;
    padding: 0 2px 14px;
    border: 0;
    color: var(--av-muted);
    background: transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.settings-tabs button[aria-selected="true"] {
    color: var(--av-navy);
}

.settings-tabs button[aria-selected="true"]::after {
    position: absolute;
    inset: auto 0 -1px;
    height: 3px;
    background: var(--av-turquoise);
    content: "";
}

.settings-panel {
    padding: 25px;
    border: 1px solid var(--av-line);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.95);
}

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 23px;
}

.panel-heading h2 {
    margin: 0;
    color: var(--av-navy);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 27px;
    font-weight: 500;
}

.panel-heading p {
    margin: 6px 0 0;
    color: var(--av-muted);
    font-size: 13px;
}

.author-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
}

.author-card {
    padding: 20px;
    border: 1px solid var(--av-line);
    border-radius: 4px;
    background: #fff;
}

.author-card.is-inactive {
    opacity: 0.6;
}

.author-card > div:first-child {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: var(--av-navy);
    background: var(--av-aqua-100);
    font-size: 12px;
    font-weight: 850;
}

.author-card h3 {
    margin: 0;
    font-size: 14px;
}

.author-card h3 + p {
    margin: 3px 0 0;
    color: var(--av-muted);
    font-size: 12px;
}

.author-default {
    margin-left: auto;
    padding: 4px 7px;
    border-radius: 999px;
    color: var(--av-success);
    background: var(--av-success-soft);
    font-size: 9px;
    font-weight: 850;
    text-transform: uppercase;
}

.author-meta {
    min-height: 17px;
    margin: 17px 0;
    color: var(--av-muted);
    font-size: 11px;
}

.author-actions {
    padding-top: 13px;
    border-top: 1px solid #edf1f1;
}

.author-actions .table-action {
    margin: 0 15px 0 0;
}

.template-readiness {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 23px;
    padding: 13px 15px;
    border: 1px solid #c8dedb;
    border-radius: 4px;
    color: #175f5a;
    background: var(--av-success-soft);
}

.template-readiness.is-warning {
    border-color: #ead5ac;
    color: #775018;
    background: var(--av-warning-soft);
}

.template-readiness-mark {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 38px;
    height: 46px;
    border: 2px solid currentColor;
    border-radius: 2px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.05em;
}

.template-readiness strong,
.template-readiness small {
    display: block;
}

.template-readiness strong {
    font-size: 13px;
}

.template-readiness small {
    margin-top: 3px;
    color: var(--av-muted);
    font-size: 11px;
}

.template-admin-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
    gap: 25px;
    align-items: start;
}

.subpanel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    min-height: 57px;
    margin-bottom: 13px;
}

.subpanel-heading h3 {
    margin: 0;
    color: var(--av-navy);
    font-size: 15px;
}

.subpanel-heading p {
    margin: 5px 0 0;
    color: var(--av-muted);
    font-size: 11px;
    line-height: 1.4;
}

.subpanel-heading > span {
    flex: 0 0 auto;
    padding: 5px 8px;
    border-radius: 999px;
    color: var(--av-aqua-600);
    background: var(--av-aqua-50);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.template-loading {
    grid-column: 1 / -1;
    min-height: 150px;
    margin: 0;
    padding: 60px 20px;
    border: 1px solid var(--av-line);
    border-radius: 4px;
    color: var(--av-muted);
    background: #fbfcfc;
    font-size: 13px;
    text-align: center;
}

.template-card {
    display: flex;
    flex-direction: column;
    min-height: 270px;
    padding: 17px;
    border: 1px solid var(--av-line);
    border-radius: 4px;
    background: #fff;
    transition: border-color 120ms ease, opacity 120ms ease;
}

.template-card.is-inactive {
    border-style: dashed;
    background: #f8f9f9;
}

.template-card > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.template-card h4 {
    margin: 0;
    color: var(--av-navy);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.25;
}

.template-card code {
    display: block;
    margin-top: 5px;
    color: var(--av-muted);
    font-family: Consolas, "Courier New", monospace;
    font-size: 9px;
}

.template-status {
    flex: 0 0 auto;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 850;
    text-transform: uppercase;
}

.template-status.is-active {
    color: var(--av-success);
    background: var(--av-success-soft);
}

.template-status.is-inactive {
    color: #68777c;
    background: #edf1f1;
}

.template-card dl {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    margin: 16px 0 0;
    padding: 10px 0;
    border-top: 1px solid #edf1f1;
    border-bottom: 1px solid #edf1f1;
}

.template-card dt,
.template-card dd {
    margin: 0;
    padding: 3px 0;
    font-size: 10px;
}

.template-card dt {
    color: var(--av-muted);
    font-weight: 750;
}

.template-card dd {
    overflow: hidden;
    color: var(--av-ink);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-card-assignment {
    margin: 13px 0;
    color: var(--av-muted);
    font-size: 10px;
    line-height: 1.4;
}

.template-card-assignment strong,
.template-card-assignment span {
    display: block;
}

.template-card-assignment strong {
    margin-bottom: 4px;
    color: #40545a;
    font-size: 10px;
}

.template-card-assignment ul {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.template-card-assignment li {
    padding: 3px 6px;
    border-radius: 2px;
    color: var(--av-aqua-600);
    background: var(--av-aqua-50);
    font-weight: 750;
}

.template-card footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #edf1f1;
}

.template-toggle {
    width: 100%;
}

.template-toggle:disabled {
    cursor: not-allowed;
}

.assignment-panel {
    padding: 18px;
    border: 1px solid var(--av-line);
    border-radius: 4px;
    background: #f9fbfb;
}

.assignment-list {
    display: grid;
    gap: 9px;
}

.assignment-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px 10px;
    align-items: end;
    padding: 13px;
    border: 1px solid #dce4e5;
    border-radius: 3px;
    background: #fff;
}

.assignment-row > div {
    grid-column: 1 / -1;
}

.assignment-row h4 {
    margin: 0;
    color: var(--av-navy);
    font-size: 12px;
}

.assignment-row p {
    margin: 3px 0 0;
    color: var(--av-muted);
    font-size: 9px;
    text-transform: uppercase;
}

.assignment-row label {
    min-width: 0;
}

.assignment-row select {
    width: 100%;
    height: 36px;
    padding: 0 29px 0 9px;
    border: 1px solid #c8d3d5;
    border-radius: 3px;
    color: var(--av-ink);
    background: #fff;
    font: inherit;
    font-size: 11px;
}

.assignment-row .button {
    min-width: 78px;
}

.settings-form {
    max-width: 760px;
    margin-top: 20px;
}

.settings-form + .settings-form {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--av-line);
}

.settings-form fieldset {
    margin: 0;
    padding: 0;
    border: 0;
}

.settings-form legend {
    margin-bottom: 18px;
    color: var(--av-navy);
    font-size: 14px;
    font-weight: 800;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 19px;
}

.settings-grid .span-2,
.dialog-grid .span-2 {
    grid-column: span 2;
}

.compact-form {
    max-width: 560px;
}

.audit-result {
    font-size: 11px;
    font-weight: 850;
}

.audit-result.is-success { color: var(--av-success); }
.audit-result.is-failure,
.audit-result.is-denied { color: var(--av-danger); }
.audit-result.is-pending { color: var(--av-warning); }

.ai-editor-section {
    border-color: #bcdedb;
    background:
        linear-gradient(145deg, rgba(216, 240, 237, 0.42), transparent 56%),
        rgba(255, 255, 255, 0.98);
}

.ai-editor-section > label:not(.checkbox-field) {
    display: block;
    margin: 18px 0 7px;
    color: #33474e;
    font-size: 12px;
    font-weight: 800;
}

.ai-editor-section > textarea,
.ai-proposal textarea {
    width: 100%;
    min-height: 130px;
    padding: 11px 12px;
    border: 1px solid #b9cecf;
    border-radius: 3px;
    color: var(--av-ink);
    background: rgba(255, 255, 255, 0.94);
    font: inherit;
    font-size: 14px;
    line-height: 1.55;
    resize: vertical;
}

.ai-editor-section > textarea:focus,
.ai-proposal textarea:focus {
    border-color: var(--av-focus);
    box-shadow: 0 0 0 3px rgba(8, 127, 134, 0.08);
    outline: 0;
}

.ai-editor-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 17px 0 2px;
    padding: 11px 13px;
    border: 1px solid #c8dedb;
    border-radius: 3px;
    color: #175f5a;
    background: var(--av-success-soft);
    font-size: 11px;
}

.ai-editor-status.is-disabled {
    border-color: #ead5ac;
    color: #775018;
    background: var(--av-warning-soft);
}

.ai-editor-status strong,
.ai-editor-status span {
    display: block;
}

.ai-editor-status span {
    color: var(--av-muted);
    text-align: right;
}

.ai-anonymization-check {
    margin-top: 15px !important;
    color: #33474e;
    font-size: 12px;
    font-weight: 750;
}

.ai-editor-actions,
.ai-proposal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 17px;
}

.ai-proposal {
    margin-top: 21px;
    padding: 18px;
    border: 1px solid #b8d8d5;
    border-left: 4px solid var(--av-aqua-600);
    border-radius: 3px;
    background: #fff;
}

.ai-proposal-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 13px;
}

.ai-proposal-heading strong {
    display: block;
    margin-top: 4px;
    color: var(--av-navy);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 19px;
    font-weight: 500;
}

.ai-proposal-heading > span {
    color: var(--av-muted);
    font-size: 10px;
    font-weight: 750;
}

.ai-proposal p {
    margin: 10px 0 0;
    color: var(--av-muted);
    font-size: 11px;
    line-height: 1.45;
}

.ai-proposal-actions {
    justify-content: flex-end;
}

.ai-overview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 17px;
}

.ai-overview-card {
    min-height: 310px;
    padding: 23px;
    border: 1px solid var(--av-line);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 35px rgba(18, 38, 45, 0.04);
}

.ai-status-card {
    border-top: 4px solid var(--av-turquoise);
    padding-top: 20px;
}

.ai-privacy-card {
    background:
        linear-gradient(145deg, rgba(233, 223, 209, 0.34), transparent 65%),
        #fff;
}

.ai-card-heading {
    display: flex;
    align-items: center;
    gap: 13px;
}

.ai-card-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    color: var(--av-aqua-600);
    background: var(--av-aqua-100);
    font-size: 12px;
    font-weight: 900;
}

.ai-card-heading h2 {
    margin: 4px 0 0;
    color: var(--av-navy);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 22px;
    font-weight: 500;
}

.ai-service-state {
    margin-top: 24px;
}

.ai-service-state p {
    margin: 10px 0 0;
    color: var(--av-muted);
    font-size: 12px;
    line-height: 1.5;
}

.ai-status-details {
    margin: 20px 0 0;
}

.ai-status-details > div {
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr);
    gap: 14px;
    padding: 9px 0;
    border-top: 1px solid #e8eeee;
    font-size: 11px;
}

.ai-status-details dt {
    color: var(--av-muted);
    font-weight: 750;
}

.ai-status-details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.ai-feature-list,
.ai-privacy-list {
    margin: 23px 0 0;
    padding: 0;
    list-style: none;
}

.ai-feature-list li {
    padding: 14px 0;
    border-top: 1px solid #e8eeee;
}

.ai-feature-list strong,
.ai-feature-list span {
    display: block;
}

.ai-feature-list strong {
    color: var(--av-navy);
    font-size: 13px;
}

.ai-feature-list span {
    margin-top: 5px;
    color: var(--av-muted);
    font-size: 12px;
    line-height: 1.45;
}

.ai-privacy-list li {
    position: relative;
    margin-top: 13px;
    padding-left: 22px;
    color: #45585f;
    font-size: 12px;
    line-height: 1.5;
}

.ai-privacy-list li::before {
    position: absolute;
    top: 2px;
    left: 0;
    color: var(--av-aqua-600);
    font-weight: 900;
    content: "✓";
}

.ai-activity-panel {
    margin-top: 22px;
}

.ai-settings-readiness {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    padding: 12px 14px;
    border: 1px solid var(--av-line);
    border-radius: 3px;
    background: #f8fafa;
    color: var(--av-muted);
    font-size: 12px;
}

.ai-settings-form {
    max-width: 800px;
}

.ai-enabled-field {
    margin-bottom: 20px !important;
    padding: 13px 15px;
    border: 1px solid #c7dedb;
    border-radius: 3px;
    color: #175f5a !important;
    background: var(--av-success-soft);
}

.ai-settings-grid label small {
    display: block;
    margin-top: 5px;
    color: var(--av-muted);
    font-size: 10px;
    font-weight: 500;
}

.ai-endpoint-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 0 0 20px;
    padding: 12px 14px;
    border-left: 3px solid var(--av-aqua-600);
    background: var(--av-aqua-50);
    font-size: 11px;
}

.ai-endpoint-note span {
    color: var(--av-muted);
    text-align: right;
}

.ai-settings-warning {
    max-width: 800px;
    margin-top: 27px;
    padding: 16px 18px;
    border: 1px solid #e5d8c2;
    border-radius: 3px;
    background: var(--av-sand-50);
}

.ai-settings-warning strong {
    color: var(--av-navy);
    font-size: 12px;
}

.ai-settings-warning p {
    margin: 5px 0 0;
    color: var(--av-muted);
    font-size: 12px;
    line-height: 1.5;
}

.app-dialog {
    width: min(540px, calc(100vw - 80px));
    max-height: calc(100vh - 70px);
    padding: 31px 34px 29px;
    border: 0;
    border-radius: 6px;
    color: var(--av-ink);
    background: #fff;
    box-shadow: 0 32px 110px rgba(5, 21, 27, 0.3);
    overflow: auto;
}

.app-dialog::backdrop {
    background: rgba(8, 25, 31, 0.64);
    backdrop-filter: blur(3px);
}

.app-dialog h2 {
    margin: 8px 0 11px;
    color: var(--av-navy);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 30px;
    font-weight: 500;
    line-height: 1.2;
}

.app-dialog p {
    margin: 0;
    color: var(--av-muted);
    font-size: 14px;
    line-height: 1.55;
}

.dialog-symbol {
    display: grid;
    place-items: center;
    width: 45px;
    height: 45px;
    margin-bottom: 17px;
    border-radius: 50%;
    color: var(--av-success);
    background: var(--av-success-soft);
    font-size: 22px;
    font-weight: 800;
}

.dialog-symbol.is-warning {
    color: var(--av-warning);
    background: var(--av-warning-soft);
}

.dialog-symbol.is-danger {
    color: var(--av-danger);
    background: var(--av-danger-soft);
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--av-line);
}

.dialog-actions.spread {
    justify-content: space-between;
}

.dialog-actions.spread > div {
    display: flex;
    gap: 9px;
}

.validation-summary {
    margin: 20px 0 0;
    padding: 0;
    border: 1px solid var(--av-line);
    border-radius: 3px;
    list-style: none;
}

.validation-summary li {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 13px;
    border-bottom: 1px solid #e9eeee;
    font-size: 12px;
}

.validation-summary li:last-child { border-bottom: 0; }
.validation-summary strong { color: var(--av-muted); }
.validation-summary span { text-align: right; }

.archive-dialog-large {
    width: min(940px, calc(100vw - 70px));
}

.archive-detail-header {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    padding-bottom: 19px;
    border-bottom: 1px solid var(--av-line);
}

.archive-detail-header h2 {
    margin-top: 5px;
}

.dialog-close {
    align-self: flex-start;
    width: 38px;
    height: 38px;
    border: 1px solid var(--av-line);
    border-radius: 50%;
    color: var(--av-muted);
    background: #fff;
    font-size: 24px;
    cursor: pointer;
}

.archive-detail-layout {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 25px;
    margin-top: 23px;
}

.archive-detail-layout dl {
    display: grid;
    grid-template-columns: 135px minmax(0, 1fr);
    align-content: start;
    margin: 0;
}

.archive-detail-layout dt,
.archive-detail-layout dd {
    margin: 0;
    padding: 10px 0;
    border-bottom: 1px solid #edf1f1;
    font-size: 12px;
}

.archive-detail-layout dt {
    color: var(--av-muted);
    font-weight: 750;
}

.archive-detail-layout dd {
    color: var(--av-ink);
}

.pdf-placeholder {
    display: grid;
    place-items: center;
    min-height: 280px;
    padding: 30px;
    border: 1px solid #d9e1e2;
    background:
        linear-gradient(135deg, transparent 49%, rgba(60, 180, 187, 0.06) 50%, transparent 51%),
        var(--av-sand-50);
    background-size: 28px 28px;
    text-align: center;
}

.pdf-placeholder span {
    display: grid;
    place-items: center;
    width: 70px;
    height: 88px;
    border: 2px solid var(--av-aqua-600);
    color: var(--av-aqua-600);
    background: #fff;
    font-size: 14px;
    font-weight: 850;
}

.pdf-placeholder p {
    margin-top: -55px;
    max-width: 240px;
    font-size: 12px;
}

.dialog-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 22px;
}

.checkbox-field {
    display: flex !important;
    align-items: center;
    gap: 9px;
    margin: 4px 0 0 !important;
}

.checkbox-field input {
    width: 18px;
    height: 18px;
}

.reason-dialog label,
#reason-form label {
    display: block;
    margin-top: 20px;
}

.toast-region {
    position: fixed;
    z-index: 100;
    right: 25px;
    bottom: 25px;
    display: grid;
    gap: 9px;
    width: min(390px, calc(100vw - 50px));
    pointer-events: none;
}

.toast {
    padding: 13px 15px;
    border: 1px solid #b8dcd7;
    border-left: 4px solid var(--av-success);
    border-radius: 3px;
    color: #155f59;
    background: #f3fbf9;
    box-shadow: 0 14px 38px rgba(13, 45, 53, 0.17);
    font-size: 13px;
    line-height: 1.45;
    animation: toast-enter 180ms ease-out;
}

.toast.is-error {
    border-color: #ebc7c9;
    border-left-color: var(--av-danger);
    color: #7b2930;
    background: var(--av-danger-soft);
}

.toast.is-info {
    border-color: #cddcde;
    border-left-color: var(--av-aqua-600);
    color: var(--av-navy);
    background: #f5fafa;
}

@keyframes toast-enter {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: translateY(0); }
}

.support-reference {
    margin-top: 25px;
    color: var(--av-muted);
    font-size: 13px;
}

@media (max-width: 1279px) {
    :root { --app-sidebar-width: 205px; }
    .app-main { padding-right: 30px; padding-left: 30px; }
    .editor-columns { grid-template-columns: minmax(465px, 1.1fr) minmax(360px, 0.9fr); gap: 18px; }
    .archive-filters { grid-template-columns: repeat(4, minmax(135px, 1fr)); }
    .archive-filters .wide { grid-column: span 2; }
    .filter-actions { justify-content: flex-end; }
    .template-admin-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; }
    .template-grid { grid-template-columns: 1fr; }
    .ai-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ai-privacy-card { grid-column: span 2; min-height: 230px; }
}

@media (max-width: 1100px) {
    .editor-columns { grid-template-columns: 1fr; }
    .text-workbench { position: static; }
    .document-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .author-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ai-overview-grid { grid-template-columns: 1fr; }
    .ai-privacy-card { grid-column: auto; }
}

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

@media print {
    .app-topbar,
    .app-sidebar,
    .editor-toolbar,
    .editor-actions,
    .back-button,
    .save-state { display: none !important; }
    .app-shell { display: block; }
    .app-main { padding: 0; }
    .editor-columns { display: block; }
    .text-workbench { position: static; margin-top: 20px; box-shadow: none; }
}
