/* Navigation, profil et règles de mise en page communes à tous les écrans. */
:root {
    --sidebar-width: 256px;
    --topbar-height: 78px;
    --bottom-nav-height: 0px;
    --navy: #13264B;
    --surface: #F4F6FA;
    --card: #FFFFFF;
    --soft: #F7F9FC;
    --text: #1D2E4B;
    --muted: #65738B;
    --border: #E1E7F0;
    --focus: #6B91EA;
    --bs-body-color: var(--text);
    --bs-body-bg: var(--surface);
    --bs-secondary-color: var(--muted);
    --bs-tertiary-bg: var(--soft);
    --bs-border-color: var(--border);
    color-scheme: light;
}
[data-theme="dark"] {
    --surface: #101A2C;
    --card: #19263D;
    --soft: #202E46;
    --text: #E5ECF7;
    --muted: #ACBAD0;
    --border: #304059;
    --color-primary: #95B4FF;
    --navy: #101B30;
    --focus: #A3BEFF;
    color-scheme: dark;
}
html { scroll-padding-top: calc(var(--topbar-height) + 20px); }
body { font-size: 13px; -webkit-text-size-adjust: 100%; }
[hidden] { display: none!important; }
.app-main { min-width: 0; min-height: 100dvh; margin-left: var(--sidebar-width); padding-top: var(--topbar-height); padding-bottom: var(--bottom-nav-height); }
#main-content { min-width: 0; width: 100%; padding: 30px clamp(20px,2.2vw,38px); max-width: 1640px; }
.page-heading { align-items: flex-start; gap: 20px; }
.page-heading h1 { font-size: clamp(24px,2vw,30px); line-height: 1.4; letter-spacing: -.8px; }
.page-heading p { font-size: 13px; line-height: 1.8; color: var(--muted); }
.page-heading>div:first-child { flex: 1; }
.page-actions { flex-shrink: 1; justify-content: flex-end; }
.page-actions .btn { white-space: normal; text-align: center; }
.section-heading { gap: 14px; flex-wrap: wrap; }
.section-heading>div { min-width: 0; }
.section-heading h2,.chart-panel h2 { font-size: 15px; line-height: 1.55; }
.section-heading p { font-size: 12px; line-height: 1.8; }
.app-footer { margin-bottom: 0; flex-wrap: wrap; align-items: center; font-size: 11px; padding: 18px 30px; }
.app-footer>span { flex-wrap: wrap; }
.is-editor .app-footer { margin-bottom: 0; }
.btn { font-size: 12px; min-height: 42px; border-radius: 8px; }
.icon-button { position: relative; min-width: 40px; min-height: 40px; border-radius: 9px; }
.btn-text { color: var(--color-primary); }
.form-label { font-size: 12px; font-weight: 600; color: var(--text); }
.form-control,.form-select { font-size: 13px; min-height: 44px; color: var(--text); background-color: var(--card); border-color: var(--border); border-radius: 8px; }
.form-control:focus,.form-select:focus { background-color: var(--card); color: var(--text); border-color: var(--focus); box-shadow: 0 0 0 3px #6B91EA20; }
.form-control::placeholder { color: var(--muted); opacity: .85; }
.form-check-input { border-color: #9AAAC4; flex-shrink: 0; }
.form-note,.panel-footnote { color: var(--muted); font-size: 12px; line-height: 1.8; }
.table { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-border-color: var(--border); }
.table-responsive { min-width: 0; max-width: 100%; overflow: auto; overscroll-behavior-inline: contain; }
.panel,.document-panel,.explorer-content,.profile-layout>* { min-width: 0; }
.avatar { overflow: hidden; width: 37px; height: 37px; }
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
:is(.person-cell,.file-cell)>div { min-width: 0; }
:is(.person-cell,.file-cell) strong,.person-cell small,.document-name,.scope-path,.notification-list strong,.notification-list p { overflow-wrap: anywhere; }
.skip-link { left: 12px; }
.skip-link:focus { top: calc(var(--topbar-height) + 6px); }

/* Une navigation fixe. Seule la liste de liens défile dans la barre latérale. */
.sidebar { position: fixed; inset: 0 auto 0 0; height: 100dvh; width: var(--sidebar-width); padding: 0; display: flex; flex-direction: column; overflow: hidden; background: #13264B; border-right: 1px solid #ffffff0a; z-index: 1040; visibility: visible; transform: none; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 24px 20px 21px; flex-shrink: 0; }
.sidebar-head .brand { padding: 0; gap: 10px; min-width: 0; }
.sidebar .brand strong { font-size: 20px; }
.sidebar .brand span { font-size: 9px; letter-spacing: 0; color: #B4C3DF; }
.sidebar-head>.icon-button { display: none; color: #D3DDF0; }
.sidebar .tenant-identity { margin: 0 16px 14px; padding: 12px; background: #ffffff06; border-color: #ffffff15; flex-shrink: 0; }
.sidebar .tenant-identity>div { min-width: 0; }
.sidebar .tenant-identity strong { overflow-wrap: anywhere; font-size: 13px; }
.sidebar .tenant-identity>div>span { margin-top: 3px; font-size: 10px; color: #ADBFDC; }
.sidebar-nav { flex: 1; overflow-y: auto; min-height: 0; padding: 0 14px 14px; scrollbar-width: thin; scrollbar-color: #465D82 transparent; overscroll-behavior: contain; }
.sidebar .nav-section { color: #9BACCA; margin: 20px 12px 9px; font-size: 10px; font-weight: 400; }
.sidebar .nav-section:first-child { margin-top: 4px; }
.sidebar .nav-item { position: relative; display: flex; min-height: 44px; padding: 11px 12px; margin: 3px 0; gap: 11px; font-size: 11px; line-height: 1.5; border-radius: 8px; color: #CBD6E9; border: 1px solid transparent; }
.sidebar .nav-item>.icon { width: 18px; height: 18px; color: #A5B9D7; }
.sidebar .nav-item>span:not(.nav-count) { min-width: 0; flex: 1; }
.sidebar .nav-item.active { border: 1px solid #738CBD32; background: #2B4269; color: #FFF; box-shadow: none; }
.sidebar .nav-item.active>.icon { color: #E7BC63; }
.sidebar .nav-item.active:before { content: ''; position: absolute; left: -1px; height: 19px; top: calc(50% - 9px); width: 3px; background: #E7BC63; border-radius: 2px; }
.sidebar .nav-item:hover { background: #ffffff0a; color: #FFF; }
.sidebar .nav-item.active:hover { background: #304A76; }
.nav-count { margin-left: auto; background: #ffffff12; color: #CBD7ED; font-size: 10px; padding: 1px 6px; border-radius: 5px; }
.sidebar-bottom { margin-top: 0; padding: 12px 16px 13px; border-top: 1px solid #ffffff13; flex-shrink: 0; }
.sidebar-volume { display: flex; align-items: center; gap: 8px; color: #AABCDC; font-size: 9px; padding: 0 4px 12px; }
.sidebar-volume .icon { width: 14px; height: 14px; }
.sidebar-volume strong { color: #DCE5F4; font-weight: 600; }
.sidebar-account { display: flex; align-items: center; gap: 5px; background: #ffffff06; padding: 10px 7px 10px 10px; border-radius: 9px; }
.sidebar-account>a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; color: #fff; }
.sidebar-account>a>span:last-child { min-width: 0; }
.sidebar-account strong,.sidebar-account small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-account strong { font-size: 11px; }
.sidebar-account small { color: #A9BCDC; font-size: 9px; margin-top: 3px; }
.sidebar-account .avatar { width: 33px; height: 33px; font-size: 10px; background: #D8E3F6; }
.sidebar-account .icon-button { color: #B7C8E3; min-width: 33px; min-height: 37px; }
.sidebar-account .icon-button .icon { width: 16px; }
.sidebar .product-credit { border: 0; margin: 0; padding: 12px 6px 0; font-size: 9px; color: #A1B4D4; }
.sidebar-scrim { display: none; border: 0; padding: 0; }
.topbar { position: fixed; inset: 0 0 auto var(--sidebar-width); height: var(--topbar-height); padding: 0 clamp(20px,2.2vw,38px); display: grid; grid-template-columns: minmax(135px,1fr) minmax(190px,360px) auto; align-items: center; gap: 20px; z-index: 1030; background: var(--card); border-bottom: 1px solid var(--border); }
.topbar-context { display: flex; gap: 9px; min-width: 0; font-size: 11px; }
.topbar-context>span { color: var(--muted); flex-shrink: 0; }
.topbar-context strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.topbar-context .icon { width: 12px; color: #95A5BF; }
.topbar .global-search { width: 100%; min-width: 0; margin: 0; padding: 9px 12px; min-height: 41px; border: 1px solid var(--border); border-radius: 8px; background: var(--soft); }
.global-search input { width: 100%; min-width: 0; font-size: 11px; }
.global-search>.icon { display: block; width: 16px; }
.global-search kbd { padding: 2px 4px; flex-shrink: 0; font-size: 9px; }
.topbar-actions { display: flex; gap: 3px; }
.topbar-actions>.icon-button { color: var(--muted); }
.topbar-divider { margin: 0 10px; }
.topbar .profile-button { min-height: 44px; padding: 0 2px; gap: 9px; }
.profile-text { display: block; }
.profile-text strong { max-width: 125px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.profile-text small { font-size: 9px; max-width: 125px; }
.topbar .mobile-brand,.mobile-bottom-nav { display: none; }

/* Graphiques et chiffres du périmètre autorisé. */
.dashboard-welcome { padding: 24px 28px; border-radius: 12px; background: #EAF0FC; border-color: #DBE4F5; }
.dashboard-welcome h2 { font-size: clamp(20px,1.7vw,25px); color: #244374; }
.dashboard-welcome p { color: #526A8E; font-size: 12px; line-height: 1.8; }
.dashboard-welcome a { font-size: 12px; }
.role-chip { font-size: 11px; color: #4D6790; }
.revised-stats { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
.revised-stats .stat-item { padding: 20px 18px; min-width: 0; gap: 12px; }
.stat-label { font-size: 11px; min-height: 0; }
.revised-stats strong { font-size: 29px; line-height: 1.4; }
.revised-stats small { font-size: 10px; line-height: 1.7; }
.analytics-grid { grid-template-columns: minmax(0,1.85fr) minmax(290px,1fr); gap: 20px; margin-bottom: 20px; }
.chart-panel { padding: 24px; border-radius: 12px; }
.chart-panel .section-heading { align-items: flex-start; }
.chart-panel .section-heading p { font-size: 11px; color: var(--muted); }
.period-switch { margin: 0; padding: 3px; border-radius: 8px; }
.period-switch button { min-height: 34px; min-width: 58px; padding: 7px; font-size: 11px; border-radius: 6px; }
.activity-summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px 24px; padding: 10px 0 4px; }
.activity-summary>span { font-size: 11px; color: var(--muted); }
.activity-summary strong { font-size: 24px; color: var(--text); margin-right: 4px; font-weight: 600; }
.activity-summary small { font-size: 10px; color: var(--muted); margin-left: auto; }
.chart-legend { gap: 20px; flex-wrap: wrap; margin: 14px 0 15px; }
.chart-legend span { font-size: 11px; }
.legend-dot { width: 8px; height: 8px; }
.activity-chart-wrap { height: 230px; }
.chart-data { font-size: 10px; margin-top: 14px; }
.chart-data summary { min-height: 25px; }
.chart-data table { font-size: 11px; }
.format-chart-panel { display: block; }
.format-chart { width: 210px; height: 210px; margin: 19px auto 23px; }
.chart-center strong { font-size: 35px; line-height: 1.4; }
.chart-center span { font-size: 11px; }
.format-legend { gap: 12px 20px; }
.format-legend>span { font-size: 12px; }
.format-legend strong { font-size: 12px; }
.classification-grid { display: grid; grid-template-columns: minmax(0,1.85fr) minmax(290px,1fr); gap: 20px; margin-bottom: 30px; }
.chart-total { padding: 5px 9px; border-radius: 6px; background: var(--soft); color: var(--muted); font-size: 10px; white-space: nowrap; }
.classification-chart-wrap { height: 225px; position: relative; }
.classification-quality .section-heading>.icon { color: #7C92B4; }
.quality-number { display: flex; align-items: flex-end; gap: 15px; margin: 28px 0 20px; }
.quality-number>strong { font-size: 45px; line-height: 1; letter-spacing: -2px; font-weight: 600; }
.quality-number strong>span { font-size: 24px; font-weight: 400; color: var(--muted); margin-left: 2px; }
.quality-number>span { font-size: 11px; color: var(--muted); max-width: 100px; line-height: 1.6; }
.quality-track { height: 7px; background: var(--soft); border-radius: 10px; margin-bottom: 22px; overflow: hidden; }
.quality-track>span { display: block; height: 100%; background: #4D72D8; border-radius: inherit; }
.quality-detail { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; font-size: 12px; }
.quality-detail>span { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.quality-detail .icon { width: 16px; height: 16px; }
.quality-action { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 17px; margin-top: 10px; border-top: 1px solid var(--border); font-size: 11px; line-height: 1.7; }
.quality-action .icon { width: 16px; flex-shrink: 0; }
.department-shelf { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.shelf-card { display: grid; grid-template-columns: 68px minmax(0,1fr); column-gap: 13px; padding: 19px; }
.shelf-card .folder-3d { grid-row: 1/3; align-self: center; }
.shelf-card h3 { min-height: 0; margin: 4px 0 3px; font-size: 12px; line-height: 1.6; }
.shelf-card>span { font-size: 11px; }
.shelf-card>.icon { display: none; }
.dashboard-lower { grid-template-columns: minmax(0,1.9fr) minmax(270px,1fr); gap: 20px; }
.activity-list p,.activity-list strong,.activity-target { font-size: 12px; }
.activity-list small { font-size: 11px; }
.activity-list li>div { min-width: 0; }

/* Profil utilisateur. */
.profile-cover { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 32px; border-radius: 14px; color: #FFF; background: #1C345C; margin-bottom: 25px; overflow: hidden; }
.profile-cover:after { content: ''; position: absolute; width: 270px; height: 270px; border: 1px solid #ffffff0c; border-radius: 45px; transform: rotate(25deg); right: 110px; top: -150px; pointer-events: none; }
.profile-cover-identity { display: flex; align-items: center; gap: 22px; min-width: 0; }
.profile-avatar { width: 88px; height: 88px; border-radius: 24px; color: #244476; background: #E8EFFB; font-size: 27px; border: 5px solid #ffffff1a; box-shadow: 0 0 0 1px #ffffff2a; }
.profile-cover-identity>div { min-width: 0; }
.profile-organization { display: flex; align-items: center; gap: 7px; font-size: 11px; color: #B5C8E9; margin-bottom: 5px; }
.profile-organization .icon { width: 14px; height: 14px; }
.profile-cover h2 { font-size: 26px; line-height: 1.4; letter-spacing: -.7px; overflow-wrap: anywhere; }
.profile-cover p { color: #BED0EC; font-size: 12px; margin: 6px 0 12px; overflow-wrap: anywhere; }
.profile-account-status { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; color: #BCDCD5; }
.profile-account-status i { width: 5px; height: 5px; background: #8CC9B8; border-radius: 50%; }
.profile-cover-stats { display: flex; gap: 29px; flex-shrink: 0; border-left: 1px solid #ffffff1f; padding: 12px 0 12px 30px; }
.profile-cover-stats strong { display: block; font-size: 31px; font-weight: 600; }
.profile-cover-stats span { color: #BDCEE6; font-size: 10px; }
.profile-layout { display: grid; grid-template-columns: minmax(0,1.85fr) minmax(285px,1fr); gap: 24px; align-items: start; }
.profile-main { overflow: hidden; border-radius: 12px; }
.profile-tabs { display: flex; background: var(--card); border-bottom: 1px solid var(--border); padding: 0 23px; gap: 21px; }
.profile-tabs>button { position: relative; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); display: flex; align-items: center; gap: 7px; min-height: 64px; padding: 0 3px; font-size: 12px; }
.profile-tabs>button[aria-selected="true"] { border-bottom-color: var(--color-primary); color: var(--color-primary); font-weight: 600; }
.profile-tabs .icon { width: 16px; height: 16px; }
.profile-main [role="tabpanel"] { padding: 27px; }
.profile-section-heading { margin-bottom: 25px; }
.profile-section-heading h2 { font-size: 16px; }
.profile-section-heading p { font-size: 12px; line-height: 1.9; margin: 8px 0 0; }
.profile-photo-field { display: flex; gap: 18px; align-items: center; padding-bottom: 25px; margin-bottom: 25px; border-bottom: 1px solid var(--border); }
.photo-avatar { width: 73px; height: 73px; border-radius: 20px; font-size: 23px; }
.profile-photo-field p { font-size: 10px; margin: 7px 0 0; }
.profile-photo-field .btn-text { padding: 6px 0 0; min-height: 25px; font-weight: 400; font-size: 10px; }
.profile-photo-field:focus-within { outline: 2px solid var(--focus); outline-offset: 4px; }
.form-hint { display: block; margin-top: 7px; font-size: 10px; color: var(--muted); }
.profile-form-footer { margin-top: 27px; padding-top: 22px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.profile-form-footer>span { font-size: 10px; color: var(--muted); max-width: 180px; }
.profile-form-footer .btn { flex-shrink: 0; }
#profile-feedback:empty { display: none; }
#profile-feedback { padding: 20px 25px 0; }
#profile-feedback .alert { margin: 0; font-size: 12px; }
.profile-aside { display: grid; gap: 22px; }
.account-summary,.profile-activity { padding: 24px; border-radius: 12px; }
.profile-aside-icon { display: grid; place-items: center; width: 39px; height: 39px; background: var(--soft); border: 1px solid var(--border); color: var(--color-primary); border-radius: 10px; margin-bottom: 15px; }
.account-summary h2 { font-size: 15px; }
.account-summary>p { font-size: 11px; line-height: 1.9; margin: 8px 0 20px; }
.account-summary dl { padding-top: 17px; border-top: 1px solid var(--border); }
.account-summary dt { font-size: 10px; color: var(--muted); font-weight: 400; }
.account-summary dd { margin: 5px 0 16px; font-size: 12px; overflow-wrap: anywhere; }
.profile-activity .section-heading { padding: 0; margin-bottom: 23px; }
.profile-activity h2 { font-size: 14px; }
.profile-activity .section-heading>.icon { color: var(--muted); width: 17px; }
.profile-activity ol { margin: 0; padding: 0; list-style: none; }
.profile-activity li { display: flex; gap: 12px; padding-bottom: 23px; }
.profile-activity li:last-child { padding-bottom: 0; }
.profile-activity li>span { display: grid; place-items: center; flex-shrink: 0; background: var(--soft); color: var(--muted); width: 27px; height: 27px; border-radius: 50%; }
.profile-activity li .icon { width: 13px; height: 13px; }
.profile-activity li>div { min-width: 0; }
.profile-activity strong { display: block; font-size: 11px; }
.profile-activity p { font-size: 11px; margin: 5px 0; overflow-wrap: anywhere; }
.profile-activity small { font-size: 10px; color: var(--muted); }
.profile-local-note { display: flex; align-items: flex-start; gap: 8px; font-size: 10px; line-height: 1.8; padding: 0 4px; }
.profile-local-note .icon { width: 15px; height: 15px; margin-top: 2px; }
.preference-fieldset { padding: 0; margin: 0 0 27px; }
.preference-fieldset legend { font-size: 12px; font-weight: 600; float: none; margin-bottom: 12px; }
.theme-options { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.theme-choice { cursor: pointer; border: 1px solid var(--border); border-radius: 10px; padding: 12px; position: relative; }
.theme-choice:has(input:checked) { border-color: var(--focus); box-shadow: 0 0 0 2px #6B91EA20; }
.theme-choice>input { position: absolute; right: 12px; bottom: 16px; accent-color: var(--org-primary); width: 15px; height: 15px; }
.theme-choice>span:last-child { display: flex; align-items: center; gap: 7px; font-size: 12px; margin-top: 12px; }
.theme-choice .icon { width: 16px; height: 16px; }
.theme-sample { display: grid; grid-template-columns: 26px 1fr 1fr; grid-template-rows: 19px 30px; gap: 7px; padding: 8px; border: 1px solid #DDE5F1; background: #F0F4FA; border-radius: 6px; }
.theme-sample i { grid-row: 1/3; background: #1D365E; border-radius: 3px; }
.theme-sample b { background: #FFF; border-radius: 3px; border: 1px solid #E1E7F0; }
.theme-sample b:first-of-type { grid-column: 2/4; }
.sample-dark { background: #101A2C; border-color: #304059; }
.sample-dark i { background: #284166; }
.sample-dark b { background: #243751; border-color: #344B6A; }
.view-preferences { display: flex; flex-wrap: wrap; gap: 12px; }
.view-preferences label { display: flex; align-items: center; gap: 9px; border: 1px solid var(--border); border-radius: 8px; padding: 13px; font-size: 11px; cursor: pointer; flex: 1; min-width: 170px; }
.view-preferences .form-check-input { margin: 0; }
.view-preferences .icon { width: 16px; }
.preference-switch { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 0; border-top: 1px solid var(--border); }
.preference-switch strong { display: block; font-size: 12px; font-weight: 600; }
.preference-switch small { display: block; font-size: 11px; line-height: 1.8; color: var(--muted); margin-top: 5px; }
.preference-switch input { width: 20px; height: 20px; }
.profile-scope { display: flex; align-items: flex-start; gap: 12px; background: var(--soft); border: 1px solid var(--border); border-radius: 9px; padding: 17px; margin-bottom: 22px; }
.profile-scope>.icon { color: var(--color-primary); width: 18px; height: 18px; margin-top: 4px; }
.profile-scope>div { min-width: 0; }
.profile-scope strong { display: block; font-size: 12px; }
.profile-scope span { display: block; color: var(--muted); font-size: 11px; margin-top: 5px; overflow-wrap: anywhere; }
.profile-permissions { list-style: none; padding: 0; margin: 0; }
.profile-permissions li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.profile-permissions li>span { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.profile-permissions .icon { width: 15px; height: 15px; color: var(--muted); }
.profile-permissions small { font-size: 10px; color: var(--muted); white-space: nowrap; }
.profile-permissions .is-granted .icon { color: #579D87; }
.profile-permissions .is-granted small { background: #EAF4EF; color: #357861; border-radius: 5px; padding: 3px 7px; }
.profile-permissions-note { font-size: 11px; line-height: 1.9; margin: 20px 0 0; }

/* Cohérence du thème, y compris dans les écrans secondaires et les fenêtres. */
[data-theme="dark"] .sidebar { background: #101B30; }
[data-theme="dark"] .sidebar .nav-item.active { background: #2B4166; }
[data-theme="dark"] .dashboard-welcome { background: #213656; border-color: #344D73; }
[data-theme="dark"] .dashboard-welcome h2 { color: #E6EEFF; }
[data-theme="dark"] .dashboard-welcome p,[data-theme="dark"] .role-chip { color: #B2C8E9; }
[data-theme="dark"] :is(.document-card-preview,.tree-info,.access-explainer,.access-note,.inline-notice) { background: #21334F; border-color: #354C6D; color: #B9CDEE; }
[data-theme="dark"] .status-success,[data-theme="dark"] .profile-permissions .is-granted small { background: #23463E; color: #A2D5BE; }
[data-theme="dark"] .status-warning { background: #4A3D25; color: #E7C17E; }
[data-theme="dark"] .status-neutral { background: #29394F; color: #B9C7DC; }
[data-theme="dark"] .department-tag { background: #263B5E; border-color: #3C5475; color: #BCD0EF; }
[data-theme="dark"] .tint-blue { background: #293F67; color: #ACC4FF; }
[data-theme="dark"] .tint-green { background: #294B44; color: #9ACEB6; }
[data-theme="dark"] .tint-gold,[data-theme="dark"] .tint-orange { background: #4C3E2C; color: #E4BD7A; }
[data-theme="dark"] .tint-purple { background: #3E375C; color: #C4B6ED; }
[data-theme="dark"] .tint-sky { background: #254451; color: #A0D0E4; }
[data-theme="dark"] .avatar { background: #31466D; color: #DEE9FF; }
[data-theme="dark"] .profile-cover .avatar { background: #DFE8F8; color: #294B7A; }
[data-theme="dark"] :is(.btn-light,.form-select,.form-control,.profile-option,.color-field,.modal-content,.toast) { background-color: var(--card); color: var(--text); border-color: var(--border); }
[data-theme="dark"] .profile-option:hover,[data-theme="dark"] .profile-option.selected { background: #273C60; border-color: #6B91CC; }
[data-theme="dark"] .btn-danger-soft { background: #462D3B; border-color: #604251; color: #EFACBB; }
[data-theme="dark"] .pdf-notice { background: #423B2B; color: #DDC894; }
[data-theme="dark"] .brand-preview img { background: #EDF3FD; border-radius: 7px; padding: 12px; }
.paper-preview,.writing-paper { background: #FFF; color: #273951; color-scheme: light; }
.paper-rich-content,.paper-rich-content p,.writing-paper p { color: #273951; }
.workbook-grid { color-scheme: light; }
.modal-dialog { width: calc(100% - 32px); max-width: 800px; margin: 16px auto; }
.modal-dialog-centered { min-height: calc(100dvh - 32px); }
.modal-content { max-height: calc(100dvh - 32px); overflow: hidden; border-radius: 13px; }
.modal-content>form { display: flex; flex-direction: column; min-height: 0; max-height: calc(100dvh - 32px); }
.modal-header,.modal-footer { flex-shrink: 0; gap: 12px; }
.modal-header { padding: 22px 24px; }
.modal-header .btn-close { flex-shrink: 0; }
.modal-title { font-size: 19px; overflow-wrap: anywhere; }
.modal-body { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; padding: 23px 24px; }
.modal-footer { padding: 16px 24px; }
.dropzone,.import-progress,.notification-list article { min-width: 0; }
#selected-file { overflow-wrap: anywhere; max-width: 100%; }
.modal-body .profile-option { min-width: 0; width: 100%; }
.profile-option>span { min-width: 0; }
.profile-option small,.profile-option strong { overflow-wrap: anywhere; }
.toast-container { max-width: 100%; bottom: calc(var(--bottom-nav-height) + 8px)!important; }
.toast { width: 390px; max-width: calc(100vw - 32px); }
.toast-body { overflow-wrap: anywhere; }
.document-grid { grid-template-columns: repeat(auto-fill,minmax(min(210px,100%),1fr)); }
.explorer-layout { min-width: 0; }
.filters { flex-wrap: wrap; gap: 10px; }
.filters .filter-search { min-width: min(100%,240px); flex: 2; }
.filters .form-select { max-width: none; flex: 1; min-width: 125px; font-size: 12px; }
.folder-card>div { min-width: 0; }
.folder-card strong { overflow-wrap: anywhere; }
.results-toolbar { gap: 12px; flex-wrap: wrap; }
.archive-breadcrumb { overflow-wrap: anywhere; white-space: normal; }
.archive-breadcrumb a { min-width: 0; }
.document-detail-layout { grid-template-columns: minmax(0,1fr) 300px; align-items: start; }
.document-inspector { display: block; }
.preview-toolbar { flex-wrap: wrap; gap: 10px; }
.preview-toolbar>span { min-width: 0; }
.document-view-tabs { flex-wrap: wrap; gap: 7px 20px; }
.document-canvas { min-height: 300px; padding: clamp(14px,2vw,28px); }
.paper-preview { width: 100%; max-width: 790px; min-height: 540px; padding: clamp(22px,3vw,45px); }
.paper-rich-content { font-size: 14px; }
.inspector-block { padding: 23px; }
.inspector-block dd { font-size: 12px; overflow-wrap: anywhere; }
.editor-titlebar { flex-wrap: wrap; }
.editor-titlebar>div:first-child { flex: 1; min-width: min(100%,210px); }
.editor-titlebar h1 { font-size: 16px; }
.editor-titlebar>div:last-child { flex-shrink: 1; flex-wrap: wrap; }
.rich-toolbar { flex-wrap: wrap; align-items: center; }
.rich-toolbar .format-button { min-height: 39px; }
.sheet-topbar { min-width: 0; }
.sheet-topbar input { min-width: 70px; }
.sheet-scroll { max-width: 100%; overscroll-behavior-inline: contain; }
.sheet-tabs { min-width: 0; flex-wrap: nowrap; overflow-x: auto; }
.sheet-tabs button { flex-shrink: 0; }
.workbook-bottom { flex-wrap: wrap; }
.writing-desk { padding: clamp(12px,2.4vw,32px); }
.writing-paper { padding: clamp(22px,4vw,48px); max-width: 790px; }
.role-cards { grid-template-columns: repeat(5,minmax(0,1fr)); }
.role-cards h2 { font-size: 13px; line-height: 1.6; }
.permission-table th,.permission-table td { font-size: 12px; }
.access-row { grid-template-columns: minmax(170px,1fr) minmax(160px,1fr) auto; }
.access-row .scope-path { grid-column: auto; grid-row: auto; font-size: 12px; }
.access-row>.btn,.access-row>.muted { grid-column: auto; grid-row: auto; }
.settings-layout { grid-template-columns: minmax(0,1.6fr) minmax(270px,1fr); }
.settings-layout>aside { display: block; }
.brand-preview img { max-width: 100%; }
.help-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.help-card p { font-size: 12px; line-height: 1.9; }
.user-table td:nth-child(3),.audit-table td { overflow-wrap: anywhere; }
.auth-main { color-scheme: light; min-width: 0; }
.auth-form-wrap,.demo-profile-grid button,.demo-profile-grid button>span { min-width: 0; }
.demo-profile-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.demo-profile-grid strong,.demo-profile-grid small { overflow-wrap: anywhere; }
.demo-profile-grid .avatar,.demo-profile-grid button>.icon { flex-shrink: 0; }
.password-label { flex-wrap: wrap; gap: 6px 12px; }

@media (min-width:1200px) and (max-width:1399px) {
    .profile-text { display: none; }
    .topbar { grid-template-columns: minmax(160px,1fr) minmax(200px,350px) auto; gap: 16px; }
    .topbar-divider { margin: 0 6px; }
    .revised-stats .stat-item { display: block; }
    .revised-stats .stat-icon { float: right; width: 31px; height: 31px; margin: 0 0 6px 8px; }
    .analytics-grid,.classification-grid,.profile-layout { grid-template-columns: minmax(0,1.7fr) minmax(270px,1fr); }
    .profile-cover-stats { gap: 19px; padding-left: 20px; }
}

/* Téléphones et tablettes, y compris les tablettes tactiles en paysage. */
@media (max-width:1199px), (hover:none) and (pointer:coarse) {
    :root { --sidebar-width: 280px; --topbar-height: 76px; --bottom-nav-height: calc(76px + env(safe-area-inset-bottom)); }
    body.menu-open { overflow: hidden; }
    .app-main { margin-left: 0; }
    .sidebar { transform: translateX(-100%); visibility: hidden; width: min(310px,calc(100vw - 32px)); transition: transform .18s ease; }
    .menu-open .sidebar { transform: translateX(0); visibility: visible; }
    .sidebar-head>.icon-button { display: inline-grid; }
    .menu-open .sidebar-scrim { display: block; position: fixed; inset: 0; background: #0C193C85; z-index: 1038; }
    .topbar { left: 0; grid-template-columns: 42px auto minmax(150px,1fr) auto; gap: 14px; padding: 0 24px; }
    .topbar [data-action="menu"] { display: inline-grid; grid-column: 1; }
    .topbar .mobile-brand { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 17px; color: var(--text); grid-column: 2; }
    .topbar-context { display: none; }
    .topbar .global-search { grid-column: 3; }
    .topbar-actions { grid-column: 4; gap: 6px; }
    .topbar-actions>[data-action="notifications"] { display: inline-grid; }
    .topbar .profile-button { display: flex; }
    .profile-text,.profile-button>.icon,.topbar-divider { display: none; }
    .mobile-bottom-nav { display: flex; position: fixed; inset: auto 0 0; height: var(--bottom-nav-height); padding: 8px max(20px,calc((100vw - 650px)/2)) calc(8px + env(safe-area-inset-bottom)); align-items: center; justify-content: space-around; background: var(--card); border-top: 1px solid var(--border); box-shadow: 0 -5px 22px #182F4F06; z-index: 1032; }
    .mobile-bottom-nav>a,.mobile-bottom-nav>button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: var(--muted); background: none; border: 0; min-width: 62px; min-height: 54px; border-radius: 10px; font-size: 11px; }
    .mobile-bottom-nav .icon { width: 22px; height: 22px; }
    .mobile-bottom-nav .active { color: var(--color-primary); background: color-mix(in srgb,var(--color-primary) 8%,transparent); }
    .mobile-bottom-nav .mobile-deposit { min-width: 61px; width: 61px; min-height: 54px; background: var(--org-primary); color: #FFF; border-radius: 13px; box-shadow: 0 4px 10px #2447a326; }
    .app-footer,.is-editor .app-footer { margin-bottom: 0; }
    .global-search kbd { display: none; }
    .profile-layout { grid-template-columns: minmax(0,1.8fr) minmax(270px,1fr); }
    .document-detail-layout { grid-template-columns: minmax(0,1fr) 290px; }
    .profile-tabs { gap: 18px; padding: 0 21px; }
    .sidebar .nav-item { font-size: 12px; min-height: 45px; }
}
@media (max-width:959px) {
    .topbar { padding: 0 20px; gap: 10px; }
    .topbar .mobile-brand { font-size: 15px; }
    .topbar-actions .profile-button { display: none; }
    .analytics-grid,.classification-grid { grid-template-columns: minmax(0,1.5fr) minmax(260px,1fr); gap: 17px; }
    .chart-panel { padding: 21px; }
    .revised-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .revised-stats .stat-item { display: flex; }
    .revised-stats .stat-icon { float: none; }
    .dashboard-lower { grid-template-columns: 1fr; }
    .dashboard-lower .activity-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 25px; }
    .explorer-layout { grid-template-columns: 1fr; }
    .folder-tree { display: none; }
    .document-detail-layout { grid-template-columns: 1fr; }
    .document-inspector { display: grid; grid-template-columns: 1fr 1fr; }
    .document-inspector .inspector-block:last-child { grid-column: 1/-1; }
    .role-cards { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .access-row { grid-template-columns: minmax(0,1fr) auto; }
    .access-row .scope-path { grid-column: 1; }
    .access-row>.btn,.access-row>.muted { grid-column: 2; grid-row: 1/3; }
    .settings-layout { grid-template-columns: 1fr; }
    .settings-layout>aside { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
    .help-grid { grid-template-columns: 1fr 1fr; }
    .profile-layout { grid-template-columns: 1fr; }
    .profile-aside { grid-template-columns: 1fr 1fr; }
    .profile-local-note { grid-column: 1/-1; }
    .profile-cover-stats { gap: 20px; padding-left: 23px; }
    .profile-cover h2 { font-size: 24px; }
    .profile-cover-stats span { display: block; max-width: 80px; }
    .profile-form-footer>span { max-width: none; }
}
@media (max-width:767px) {
    .topbar { grid-template-columns: 42px auto minmax(120px,1fr) auto; }
    .topbar .mobile-brand strong { font-size: 14px; }
    .topbar .mobile-brand img { width: 27px; height: 27px; }
    .topbar-actions>[data-action="notifications"] { display: none; }
    #main-content { padding: 25px 20px; }
    .page-heading { flex-wrap: wrap; }
    .page-actions { justify-content: flex-start; }
    .analytics-grid,.classification-grid { grid-template-columns: 1fr; }
    .classification-grid { gap: 17px; }
    .format-chart-panel { display: grid; grid-template-columns: 210px minmax(0,1fr); gap: 0 30px; align-items: center; }
    .format-chart-panel .section-heading { grid-column: 1/-1; }
    .format-legend { grid-template-columns: 1fr; gap: 17px; }
    .format-chart { margin: 12px auto 0; }
    .quality-number { margin-top: 21px; }
    .classification-quality { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
    .classification-quality .section-heading,.classification-quality .quality-track,.classification-quality .quality-action { grid-column: 1/-1; }
    .quality-number { grid-column: 1/-1; }
    .department-shelf { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .shelf-card { display: block; padding: 19px; }
    .shelf-card h3 { margin-top: 21px; min-height: 0; }
    .profile-cover { padding: 27px; flex-wrap: wrap; }
    .profile-cover-stats { border-left: 0; border-top: 1px solid #ffffff21; padding: 18px 0 0; width: 100%; gap: 35px; }
    .profile-cover-stats span { max-width: none; }
    .profile-cover-stats strong { font-size: 27px; }
    .profile-aside { gap: 17px; }
    .editor-statusbar { flex-wrap: wrap; }
    .editor-statusbar label { min-width: 0; }
    .editor-titlebar>div:last-child { width: 100%; justify-content: flex-end; }
    .sheet-topbar { flex-wrap: wrap; }
    .sheet-tools { width: 100%; }
    .form-footer { flex-wrap: wrap; }
}
@media (max-width:639px) {
    :root { --topbar-height: 118px; --bottom-nav-height: calc(74px + env(safe-area-inset-bottom)); }
    .topbar { height: var(--topbar-height); padding: 10px 15px; grid-template-columns: 40px minmax(0,1fr) auto; grid-template-rows: 42px 42px; gap: 9px 7px; align-content: center; }
    .topbar [data-action="menu"] { grid-column: 1; grid-row: 1; }
    .topbar .mobile-brand { grid-column: 2; grid-row: 1; font-size: 16px; gap: 7px; }
    .topbar .mobile-brand strong { font-size: 16px; }
    .topbar-actions { grid-column: 3; grid-row: 1; }
    .topbar-actions>.icon-button { min-width: 40px; min-height: 40px; }
    .topbar .global-search { grid-column: 1/-1; grid-row: 2; min-height: 42px; padding: 8px 11px; margin: 0; }
    .global-search input { font-size: 13px; }
    .mobile-bottom-nav { padding-left: 9px; padding-right: 9px; }
    .mobile-bottom-nav>a,.mobile-bottom-nav>button { min-width: 53px; font-size: 10px; }
    .mobile-bottom-nav .mobile-deposit { min-width: 54px; width: 54px; min-height: 54px; }
    #main-content { padding: 24px 16px; }
    .page-heading { display: block; margin-bottom: 23px; }
    .page-heading h1 { font-size: 25px; }
    .page-heading p { font-size: 12px; max-width: none; }
    .page-actions:not(:empty) { margin-top: 15px; gap: 8px; }
    .page-actions .btn { min-height: 42px; font-size: 11px; }
    .btn { min-height: 44px; font-size: 12px; }
    .icon-button { min-height: 44px; min-width: 44px; }
    .form-control,.form-select,.auth-form-wrap .form-control { font-size: 16px; min-height: 47px; }
    .form-label,.auth-form-wrap .form-label { font-size: 12px; }
    .section-heading h2,.chart-panel h2 { font-size: 15px; }
    .section-heading p { font-size: 12px; }
    .dashboard-welcome { padding: 23px; min-height: 0; margin-bottom: 20px; }
    .dashboard-welcome h2 { font-size: 21px; max-width: none; }
    .dashboard-welcome p { font-size: 12px; max-width: none; }
    .dashboard-welcome .welcome-files { display: none; }
    .dashboard-welcome a { font-size: 12px; }
    .role-chip { font-size: 11px; }
    .revised-stats { gap: 12px; }
    .revised-stats .stat-item { padding: 16px; display: block; min-height: 153px; }
    .revised-stats .stat-icon { width: 28px; height: 28px; float: right; margin: 0 0 5px 5px; }
    .revised-stats .stat-label { font-size: 11px; min-height: 35px; }
    .revised-stats strong { font-size: 27px; margin: 7px 0; }
    .revised-stats small { font-size: 10px; line-height: 1.8; min-height: 0; }
    .chart-panel { padding: 21px 17px; }
    .chart-panel .section-heading p { font-size: 11px; }
    .period-switch { margin: 0; }
    .period-switch button { min-height: 37px; font-size: 11px; }
    .activity-summary { gap: 7px 17px; }
    .activity-summary strong { font-size: 24px; }
    .activity-summary small { width: 100%; margin: 0; }
    .chart-legend { gap: 13px; }
    .chart-legend span { font-size: 10px; }
    .activity-chart-wrap { height: 205px; }
    .format-chart-panel { grid-template-columns: 155px minmax(0,1fr); gap: 0 13px; }
    .format-chart { width: 155px; height: 155px; }
    .format-legend { gap: 14px; margin: 12px 0 0; }
    .format-legend>span,.format-legend strong { font-size: 11px; }
    .chart-center strong { font-size: 28px; }
    .chart-center span { font-size: 10px; }
    .classification-chart-wrap { height: 235px; }
    .classification-quality { display: block; }
    .quality-number>strong { font-size: 43px; }
    .shelf-card { padding: 19px 17px; }
    .shelf-card h3 { font-size: 12px; }
    .shelf-card>span { font-size: 11px; }
    .dashboard-lower .activity-list { display: block; }
    .activity-panel { padding: 23px; }
    .activity-list li { padding-bottom: 24px; }
    .app-footer { padding: 20px 16px; align-items: flex-start; font-size: 10px; gap: 8px; }
    .document-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding: 13px; }
    .document-card { display: block; }
    .document-card-preview { min-height: 0; height: 133px; border-right: 0; }
    .document-card>div { padding: 14px; }
    .document-card .document-name { font-size: 11px; line-height: 1.75; }
    .document-card p { font-size: 10px; }
    .document-card-bottom .status-badge,.document-card-bottom small { font-size: 9px; }
    .card-quick-action .icon-button { min-width: 36px; min-height: 36px; }
    .folder-grid { grid-template-columns: 1fr 1fr; }
    .folder-card { min-height: 86px; gap: 10px; }
    .folder-card strong { font-size: 11px; }
    .folder-card span { font-size: 10px; }
    .filters { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 0 13px 16px; }
    .filters .filter-search { grid-column: 1/-1; min-width: 0; }
    .filters .form-select { min-width: 0; width: 100%; font-size: 13px; }
    .filters .form-select:last-child { grid-column: 1/-1; }
    .filter-search .form-control { font-size: 14px; min-height: 46px; }
    .results-toolbar { padding: 14px; font-size: 10px; }
    .results-toolbar label { margin-left: auto; }
    .pagination-bar { flex-direction: column; gap: 13px; padding: 17px 12px; }
    .pagination-bar nav { gap: 10px; }
    .pagination-bar .btn { font-size: 11px; min-height: 42px; }
    .archive-table { display: block; min-width: 0!important; width: 100%; }
    .archive-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .archive-table tbody { display: block; padding: 0 13px 10px; }
    .archive-table tbody tr { display: grid; position: relative; grid-template-columns: minmax(0,1fr) auto; gap: 8px 11px; align-items: center; margin: 12px 0; padding: 17px 14px; border: 1px solid var(--border); border-radius: 9px; }
    .archive-table tbody td { padding: 0; border: 0; min-width: 0; font-size: 11px; }
    .archive-table tbody td:first-child { grid-column: 1/-1; padding-right: 26px; margin-bottom: 5px; }
    .archive-table tbody td:last-child { position: absolute; right: 5px; top: 9px; }
    .archive-table tbody td:nth-child(2) { grid-column: 1; }
    .archive-table tbody td:nth-child(3) { grid-column: 2; text-align: right; }
    .archive-table .document-name { font-size: 12px; }
    .archive-table .file-cell>div>span,.archive-table .cell-date { font-size: 10px; }
    .archive-table .department-tag,.archive-table .status-badge { font-size: 10px; }
    .archive-table .icon-button { min-height: 36px; min-width: 36px; }
    .archive-table .cell-meta { display: none; }
    .user-table tbody tr,.audit-table tbody tr { grid-template-columns: minmax(0,1fr); gap: 11px; padding: 18px; }
    .user-table tbody td:nth-child(n),.audit-table tbody td:nth-child(n) { grid-column: 1; position: static; padding: 0; text-align: left; max-width: none; margin: 0; }
    .user-table .person-cell { padding-bottom: 8px; }
    .user-table .person-cell strong { font-size: 13px; }
    .user-table .person-cell small { font-size: 11px; }
    .user-table tbody td:nth-child(2):before { content: 'Rôle : '; color: var(--muted); }
    .user-table tbody td:nth-child(3):before { content: 'Périmètre : '; color: var(--muted); }
    .user-table tbody td:last-child .btn { width: 100%; font-size: 12px; }
    .audit-table td:before { content: attr(data-label); display: block; color: var(--muted); font-size: 10px; margin-bottom: 3px; }
    .audit-filter { padding: 18px; display: flex; flex-wrap: wrap; }
    .audit-filter input { width: 100%; flex: 1 1 180px; }
    .audit-filter .btn { flex: 1; }
    .document-detail-layout { display: grid; grid-template-columns: 1fr; }
    .document-inspector { display: block; }
    .document-canvas { padding: 13px; }
    .paper-preview { padding: 25px 20px; min-height: 460px; }
    .paper-rich-content { font-size: 13px; }
    .preview-toolbar { padding: 14px; font-size: 12px; }
    .preview-mode { font-size: 10px; }
    .preview-footnote { font-size: 11px; }
    .document-view-tabs { padding: 5px 13px; gap: 3px 9px; }
    .document-view-tabs .btn { font-size: 11px; min-height: 42px; }
    .inspector-block { padding: 22px; }
    .pdf-navigation { flex-wrap: wrap; font-size: 11px; gap: 8px; }
    .pdf-navigation .btn { font-size: 10px; }
    .editor-heading { align-items: flex-start; flex-direction: column; gap: 11px; }
    .editor-back,.editor-save-status { font-size: 11px; }
    .editor-titlebar { padding: 19px 16px; gap: 17px; }
    .editor-titlebar h1 { font-size: 15px; }
    .editor-titlebar .btn { font-size: 11px; min-height: 44px; }
    .editor-titlebar>div:last-child { gap: 8px; justify-content: space-between; }
    .rich-toolbar { padding: 9px; gap: 3px; }
    .rich-toolbar select { min-height: 40px; font-size: 12px; }
    .rich-toolbar .format-button { min-height: 40px; font-size: 11px; }
    .editor-notice { font-size: 11px; padding: 13px 16px; }
    .writing-desk { max-height: none; padding: 11px; }
    .writing-paper { padding: 24px 18px; font-size: 14px; min-height: 480px; }
    .sheet-topbar input { font-size: 16px; }
    .sheet-cell-input { font-size: 16px; width: 130px; min-height: 42px; }
    .sheet-tools .btn,.sheet-tabs button { min-height: 42px; font-size: 12px; }
    .sheet-pagination { font-size: 11px; flex-wrap: wrap; }
    .sheet-pagination .btn { min-height: 40px; font-size: 11px; }
    .editor-statusbar { padding: 17px; gap: 17px; font-size: 11px; }
    .editor-statusbar label { width: 100%; flex-direction: column; align-items: flex-start; gap: 8px; }
    .editor-statusbar input { width: 100%; font-size: 16px; min-height: 43px; }
    .role-cards { grid-template-columns: 1fr 1fr; }
    .role-cards article { padding: 19px 16px; }
    .role-cards h2 { font-size: 13px; min-height: 0; }
    .role-cards small { font-size: 11px; }
    .permission-table { display: block; min-width: 0; width: 100%; }
    .permission-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .permission-table tbody { display: block; padding: 0 16px 10px; }
    .permission-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 19px 0; border-bottom: 1px solid var(--border); }
    .permission-table th { grid-column: 1/-1; font-size: 13px; }
    .permission-table th,.permission-table td { padding: 0; border: 0; }
    .permission-table td { display: flex; align-items: center; justify-content: space-between; gap: 9px; font-size: 11px; }
    .permission-table td:before { content: attr(data-role); text-align: left; }
    .permission-table input { width: 21px; height: 21px; margin: 0; flex-shrink: 0; }
    .access-row { grid-template-columns: minmax(0,1fr); gap: 14px; padding: 21px; }
    .access-row .scope-path,.access-row>.btn,.access-row>.muted { grid-column: 1; grid-row: auto; justify-self: stretch; }
    .settings-layout>aside { grid-template-columns: 1fr; gap: 0; }
    .settings-form { padding: 23px 19px; }
    .help-grid { grid-template-columns: 1fr; }
    .help-card { padding: 24px; }
    .profile-cover { padding: 24px 21px; }
    .profile-cover-identity { gap: 16px; align-items: flex-start; }
    .profile-avatar { width: 66px; height: 66px; border-radius: 18px; font-size: 23px; }
    .profile-cover h2 { font-size: 23px; }
    .profile-cover p { font-size: 12px; }
    .profile-cover-stats { gap: 30px; }
    .profile-cover-stats span { font-size: 11px; }
    .profile-tabs { padding: 0 13px; gap: 0; justify-content: space-between; }
    .profile-tabs>button { min-height: 62px; font-size: 11px; gap: 5px; }
    .profile-tabs .icon { width: 14px; }
    .profile-main [role="tabpanel"] { padding: 23px 19px; }
    .profile-section-heading p { font-size: 12px; }
    .profile-photo-field { gap: 14px; }
    .profile-photo-field p { font-size: 10px; }
    .profile-form-footer { flex-direction: column; align-items: stretch; gap: 15px; }
    .profile-form-footer>span { font-size: 11px; }
    .profile-form-footer .btn { width: 100%; }
    .profile-aside { grid-template-columns: 1fr; gap: 18px; }
    .profile-local-note { grid-column: 1; }
    .profile-permissions li>span { font-size: 11px; }
    .profile-permissions small { font-size: 9px; }
    #profile-feedback { padding: 18px 19px 0; }
    .theme-options { gap: 12px; }
    .theme-choice { padding: 10px; }
    .view-preferences { flex-direction: column; }
    .view-preferences label { font-size: 12px; min-height: 47px; }
    .modal-dialog { width: calc(100% - 20px); margin: 10px auto; }
    .modal-dialog-centered { min-height: calc(100dvh - 20px); }
    .modal-content,.modal-content>form { max-height: calc(100dvh - 20px); }
    .modal-header,.modal-body { padding: 19px; }
    .modal-footer { padding: 14px 19px; }
    .modal-title { font-size: 18px; }
    .modal-footer>.btn,.modal-footer form>.btn { min-height: 44px; }
    .profile-option strong { font-size: 13px; }
    .profile-option small { font-size: 11px; }
    .edit-after-upload { font-size: 12px; }
    .dropzone strong { font-size: 14px; }
    .dropzone span { font-size: 12px; }
    .dropzone small { font-size: 10px; }
}
@media (max-width:359px) {
    #main-content { padding-left: 12px; padding-right: 12px; }
    .topbar { padding-left: 11px; padding-right: 11px; }
    .revised-stats .stat-item { padding: 14px 12px; }
    .revised-stats strong { font-size: 25px; }
    .chart-panel { padding: 19px 14px; }
    .format-chart-panel { grid-template-columns: 130px minmax(0,1fr); gap: 0 10px; }
    .format-chart { width: 130px; height: 130px; }
    .format-legend>span,.format-legend strong { font-size: 10px; }
    .document-grid { grid-template-columns: 1fr; }
    .document-card { display: grid; grid-template-columns: 103px minmax(0,1fr); }
    .document-card-preview { height: 100%; min-height: 147px; border-right: 1px solid var(--border); }
    .document-card>.card-quick-action { right: 6px; top: 6px; }
    .document-card>div:not(.card-quick-action) { padding-top: 41px; }
    .profile-tabs { padding: 0 10px; }
    .profile-tabs>button { gap: 4px; font-size: 10px; }
    .profile-cover { padding: 23px 17px; }
    .profile-cover h2 { font-size: 21px; }
    .profile-avatar { width: 55px; height: 55px; border-radius: 15px; font-size: 19px; }
    .profile-photo-field { flex-wrap: wrap; }
    .editor-titlebar>div:last-child .btn { width: 100%; }
    .role-cards { grid-template-columns: 1fr; }
}
@media (max-height:600px) and (max-width:1199px) {
    .sidebar-head { padding-top: 14px; padding-bottom: 12px; }
    .sidebar .tenant-identity { margin-bottom: 6px; padding: 9px; }
    .sidebar-bottom { padding-top: 9px; padding-bottom: 9px; }
    .sidebar-volume,.sidebar .product-credit { display: none; }
    .modal-header { padding-top: 12px; padding-bottom: 12px; }
    .modal-footer { padding-top: 10px; padding-bottom: 10px; }
}
[data-reduced-motion="true"] *,[data-reduced-motion="true"] *:before,[data-reduced-motion="true"] *:after { animation-duration: .01ms!important; transition-duration: .01ms!important; scroll-behavior: auto!important; }
@media print {
    .sidebar,.topbar,.mobile-bottom-nav,.app-footer,.toast-container { display: none!important; }
    .app-main { padding: 0; margin: 0; }
    #main-content { padding: 0; }
}
