* { box-sizing: border-box; }
html { min-width: 320px; background: var(--ground); scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--ground); color: var(--ink); font: var(--text-body); font-synthesis: none; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; text-underline-offset: 3px; }
[hidden] { display: none !important; }
::selection { color: var(--on-ink); background: var(--brand); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { border: 3px solid var(--ground); border-radius: var(--radius-pill); background: var(--line); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-muted); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
svg.icon { width: var(--icon-md); height: var(--icon-md); flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; }
.auth-screen { display: grid; min-height: 100vh; grid-template-columns: minmax(300px, .9fr) 1.1fr; background: var(--surface); }
.auth-intro { display: flex; min-height: 100vh; flex-direction: column; justify-content: space-between; padding: 32px clamp(28px, 5vw, 72px); background: var(--surface-muted); }
.auth-brand { align-self: flex-start; }
.auth-intro-copy { max-width: 470px; padding: 56px 0; }
.auth-intro-copy p { margin-bottom: 20px; font: 400 clamp(36px, 4vw, 58px)/1.08 var(--font-display); letter-spacing: -.025em; }
.auth-intro-copy em { color: var(--brand); font-weight: 400; }
.auth-intro-copy > span { display: block; max-width: 38ch; color: var(--ink-muted); font-size: 15px; line-height: 1.7; }
.auth-footnote { color: var(--ink-muted); font-size: 12px; }
.auth-panel { display: grid; align-content: center; justify-items: center; padding: 56px 28px; }
.auth-form-wrap { width: min(100%, 420px); }
.auth-form-wrap h1 { margin-bottom: 10px; font: var(--text-section); }
.auth-description { margin-bottom: 28px; color: var(--ink-muted); font-size: 14px; }
.auth-form { display: grid; gap: 16px; }
.auth-field { display: grid; gap: 7px; color: var(--ink); font-size: 13px; font-weight: 600; }
.auth-field input { width: 100%; min-height: 46px; padding: 10px 13px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--ground); font-size: 14px; font-weight: 400; }
.auth-field input:focus { border-color: var(--brand); outline: 2px solid color-mix(in srgb, var(--brand) 18%, transparent); outline-offset: 1px; }
.auth-submit { width: 100%; min-height: 46px; margin-top: 4px; }
.auth-error { padding: 11px 13px; border-radius: var(--radius-md); background: var(--soon-soft); color: var(--soon); font-size: 13px; line-height: 1.5; }
.auth-switch { margin-top: 22px; color: var(--ink-muted); font-size: 13px; text-align: center; }
.auth-switch button { padding: 0; border: 0; background: transparent; color: var(--brand); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; gap: 18px; width: var(--sidebar-width); height: 100vh; padding: 18px 12px 12px; overflow-y: auto; border-right: 1px solid var(--line); background: var(--surface-muted); z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 7px; color: var(--ink); }
.brand-mark { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 10px; background: var(--brand); color: white; font: 600 17px/1 var(--font-display); }
.brand-name { font: 600 15px/20px var(--font-sans); letter-spacing: -.025em; }
.brand-name span { color: var(--ink-muted); font-weight: 500; }
.company-switch { min-height: 44px; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); color: var(--ink-muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-switch strong { display: block; color: var(--ink); font-weight: 600; }
.sidebar-nav { display: grid; align-content: start; gap: 3px; }
.nav-section-title { padding: 8px 9px 4px; color: var(--ink-muted); font: var(--text-label); }
.nav-link { display: flex; min-height: 38px; align-items: center; gap: 10px; padding: 7px 9px; border-radius: var(--radius-sm); color: var(--ink-muted); font: var(--text-nav); transition: background-color .16s ease-out, color .16s ease-out; }
.nav-link:hover { background: color-mix(in srgb, var(--surface) 66%, transparent); color: var(--ink); }
.nav-link[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card); }
.nav-icon { display: grid; width: 20px; height: 20px; place-items: center; color: currentColor; }
.nav-icon .icon { width: 18px; height: 18px; }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { margin-left: auto; color: var(--ink-muted); font: var(--text-label); font-variant-numeric: tabular-nums; }
.process-nav { display: grid; gap: 2px; }
.process-nav .nav-link { min-height: 34px; font-size: 13px; }
.process-nav .domain-tile { width: 22px; height: 22px; border-radius: 7px; }
.process-nav .domain-tile .icon { width: 15px; height: 15px; }
.sidebar-bottom { display: grid; gap: 3px; margin-top: auto; }
.legacy-link { display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 6px 9px; border-radius: var(--radius-sm); color: var(--ink-muted); font-size: 12px; }
.legacy-link:hover { background: var(--surface); color: var(--ink); }
.legacy-link svg { width: 16px; height: 16px; }
.profile { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 10px 8px 2px; border-top: 1px solid var(--line); }
.profile strong, .profile small { display: block; }
.profile strong { font-size: 13px; font-weight: 600; }
.profile small { margin-top: 1px; color: var(--ink-muted); font-size: 12px; }
.avatar { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 700; }

.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; height: var(--topbar-height); align-items: center; justify-content: space-between; gap: 16px; padding: 0 32px; border-bottom: 1px solid var(--line); background: var(--ground); }
.breadcrumbs { color: var(--ink-muted); font: var(--text-small); }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.top-link { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-muted); font-size: 13px; }
.top-link:hover { color: var(--brand); }
.top-link .icon { width: 16px; height: 16px; }
.secure-label { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-muted); font-size: 12px; }
.secure-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.mobile-menu { display: none; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); }
.page { width: min(100% - 64px, var(--content-max)); margin: 0 auto; padding: 38px 0 72px; animation: page-arrive .24s cubic-bezier(.16, 1, .3, 1); }
@keyframes page-arrive { from { opacity: .7; translate: 0 5px; } to { opacity: 1; translate: 0 0; } }
.app-alert { margin: 14px auto 0; width: min(100% - 64px, var(--content-max)); padding: 11px 14px; border-radius: var(--radius-md); background: var(--soon-soft); color: var(--soon); }
.page-wide { width: min(100% - 64px, var(--content-wide)); }

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font: var(--text-page-title); letter-spacing: -.02em; }
h1 .accent { font: var(--text-accent); }
h2 { margin-bottom: 10px; font: var(--text-section); }
h3 { margin-bottom: 4px; font: var(--text-card-title); }
p { margin-bottom: 0; }
.lead { max-width: 66ch; color: var(--ink-muted); }
.greeting { margin: 0; font: var(--text-greeting); letter-spacing: -.025em; }
.greeting em { font: italic 400 40px/44px var(--font-display); }
.greeting-meta { margin: 8px 0 24px; color: var(--ink-muted); }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 12px; }
.section-heading h2 { margin: 0; }
.section-heading a { color: var(--brand); font-size: 13px; font-weight: 600; }
.section-heading a:hover { text-decoration: underline; }
.stack { display: grid; gap: 28px; }
.stack-tight { display: grid; gap: 12px; }
.split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(250px, .8fr); gap: 28px; margin-top: 30px; }
.surface { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.surface-pad { padding: 22px 24px; }
.surface-muted { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-muted); }
.empty { display: grid; justify-items: start; gap: 8px; padding: 22px 0; color: var(--ink-muted); }
.empty strong { color: var(--ink); font: var(--text-empty-state); }
.empty .button { margin-top: 8px; }
.muted { color: var(--ink-muted); }
.small { color: var(--ink-muted); font: var(--text-small); }
.label { color: var(--ink-muted); font: var(--text-label); }
.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; }
.skeleton-line { width: min(100%, 520px); height: 15px; margin: 8px 0; border-radius: var(--radius-pill); background: var(--surface-muted); }
.skeleton-line.short { width: min(58%, 280px); }
.kpi { font: var(--text-kpi); font-variant-numeric: tabular-nums; }
.error-text { color: var(--late); }
.success-text { color: var(--brand); }

.ask-form { display: flex; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card); }
.ask-form input, .field { width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: 14px; }
.ask-form input { padding: 10px 12px; border: 0; outline: 0; background: transparent; }
.ask-form input:focus-visible { outline: 0; }
.ask-form:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.ask-form input::placeholder, .field::placeholder { color: var(--ink-muted); opacity: 1; }
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: transparent; color: var(--ink); font: var(--text-button); white-space: nowrap; transition: background-color .16s ease-out, color .16s ease-out, border-color .16s ease-out; }
.button:hover { border-color: var(--ink); background: var(--surface-muted); }
.button-primary { border-color: var(--ink); background: var(--ink); color: var(--on-ink); }
.button-primary:hover { border-color: var(--brand); background: var(--brand); color: white; }
.button-small { min-height: 32px; padding: 6px 12px; font-size: 13px; }
.button:disabled { cursor: not-allowed; opacity: .52; }
.button .icon { width: 16px; height: 16px; }

.task-list { display: grid; gap: 9px; }
.task-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.task-row[data-state="late"] { background: var(--late-soft); }
.task-row[data-state="soon"] { background: var(--soon-soft); }
.task-main { display: grid; min-width: 0; gap: 5px; }
.task-title { margin: 0; font: var(--text-card-title); }
.task-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--ink-muted); font-size: 13px; }
.task-date { font-variant-numeric: tabular-nums; }
.domain-tag { display: inline-flex; min-height: 24px; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-pill); background: var(--domain-bg, var(--surface-muted)); color: var(--domain-ink, var(--ink-muted)); font: var(--text-label); white-space: nowrap; }
.domain-tile { display: grid; width: 36px; height: 36px; flex: none; place-items: center; border-radius: var(--radius-sm); background: var(--domain-bg, var(--surface-muted)); color: var(--domain-ink, var(--ink-muted)); }
.domain-tile .icon { width: 19px; height: 19px; }
[data-domain="paie"] { --domain-bg: var(--paie); --domain-ink: var(--paie-ink); }
[data-domain="recrutement"] { --domain-bg: var(--recrutement); --domain-ink: var(--recrutement-ink); }
[data-domain="gepp"] { --domain-bg: var(--gepp); --domain-ink: var(--gepp-ink); }
[data-domain="admin"] { --domain-bg: var(--admin); --domain-ink: var(--admin-ink); }
[data-domain="questions"] { --domain-bg: var(--questions); --domain-ink: var(--questions-ink); }
[data-domain="bdese"] { --domain-bg: var(--bdese); --domain-ink: var(--bdese-ink); }
.task-row[data-state="late"] .task-date { color: var(--late); font-weight: 600; }
.task-row[data-state="soon"] .task-date { color: var(--soon); font-weight: 600; }
.activity-list { display: grid; gap: 0; }
.activity-item { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.activity-item:first-child { border-top: 0; }
.activity-dot { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); }
.activity-dot .icon { width: 14px; height: 14px; }
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week-day { min-width: 0; overflow: hidden; text-align: center; display: grid; justify-items: center; gap: 7px; padding: 10px 3px; border-radius: var(--radius-md); background: var(--ground); color: var(--ink-muted); font-size: 12px; }
.week-day strong { color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.week-day.today { background: var(--brand-soft); color: var(--brand); }
.week-day.today strong { color: var(--brand); }
.week-count { min-width: 18px; min-height: 18px; text-align: center; color: var(--ink-muted); font-size: 12px; font-variant-numeric: tabular-nums; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-head p { max-width: 68ch; color: var(--ink-muted); }
.page-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.domain-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.domain-heading h1 { margin: 0; }
.process-grid, .assistant-grid, .connector-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.process-card { display: flex; min-height: 136px; align-items: flex-start; gap: 14px; padding: 18px; }
.process-card:hover { border-color: var(--ink-muted); }
.process-card-content { display: grid; gap: 6px; }
.process-card-content p { color: var(--ink-muted); }
.process-card-content .small { margin-top: 3px; }
.assistant-card { display: grid; gap: 13px; padding: 20px; }
.assistant-card-head { display: flex; align-items: flex-start; gap: 12px; }
.assistant-card-head > div:last-child { min-width: 0; }
.assistant-card p { color: var(--ink-muted); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.status { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-muted); font: var(--text-label); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-muted); }
.status[data-status="ready"] .status-dot { background: var(--brand); }
.status[data-status="draft"] .status-dot { background: var(--soon); }
.status[data-status="inactive"] .status-dot { background: var(--ink-muted); }
.connector-card { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: start; gap: 14px; padding: 18px; }
.connector-mark { display: grid; width: 48px; height: 48px; place-items: center; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--ink); font: 600 12px/1 var(--font-sans); }
.connector-card p { margin-top: 5px; color: var(--ink-muted); }
.connector-details { grid-column: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.connector-details .status { font-size: 12px; }
.connector-group { display: grid; gap: 12px; margin-top: 28px; }

.chat-layout { display: grid; min-height: min(65vh, 640px); grid-template-rows: 1fr auto; gap: 18px; }
.chat-messages { display: flex; flex-direction: column; gap: 16px; padding: 8px 2px; overflow-y: auto; }
.chat-welcome { display: grid; align-content: center; justify-items: center; gap: 12px; min-height: 300px; text-align: center; }
.chat-welcome h1 { font-size: 34px; }
.chat-welcome p { max-width: 52ch; color: var(--ink-muted); }
.suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.suggestion { min-height: 36px; padding: 7px 12px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); color: var(--ink-muted); font-size: 13px; }
.suggestion:hover { border-color: var(--brand); color: var(--brand); }
.chat-message { max-width: min(78%, 680px); padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); font: var(--text-chat); white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-message.user { align-self: flex-end; border-color: var(--ink); background: var(--ink); color: var(--on-ink); }
.chat-message.assistant { align-self: flex-start; }
.chat-message small { display: block; margin-bottom: 6px; color: var(--ink-muted); font: var(--text-label); }
.chat-message.user small { color: color-mix(in srgb, var(--on-ink) 70%, transparent); }
.citation-list { display: grid; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.citation { color: var(--brand); font: var(--text-small); }
.chat-compose { position: sticky; bottom: 8px; }
.chat-compose .ask-form { width: 100%; }
.typing { color: var(--ink-muted); font-style: italic; }

.rule-list { display: grid; gap: 12px; }
.rule-card { padding: 18px 20px; }
.rule-card summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; list-style: none; }
.rule-card summary::-webkit-details-marker { display: none; }
.rule-card summary h3 { margin: 0; }
.rule-card[open] summary { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.step-list { display: grid; gap: 12px; margin: 14px 0 0; padding: 0; list-style: none; }
.step-item { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; }
.step-number { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: var(--surface-muted); color: var(--ink-muted); font: var(--text-label); font-variant-numeric: tabular-nums; }
.step-sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.source-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: var(--radius-pill); background: var(--surface-muted); color: var(--ink-muted); font-size: 12px; }
.source-pill[data-source-state="ok"] { background: var(--brand-soft); color: var(--brand); }
.source-pill[data-source-state="missing"] { background: var(--soon-soft); color: var(--soon); }

.form-stack { display: grid; gap: 14px; }
.field-label { display: grid; gap: 6px; color: var(--ink); font-weight: 600; }
.field-label .small { font-weight: 400; }
.search-results { display: grid; gap: 8px; margin-top: 12px; }
.search-result { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); text-align: left; }
.search-result:hover { border-color: var(--brand); }
.search-result strong, .search-result small { display: block; }
.search-result small { margin-top: 3px; color: var(--ink-muted); }
.upload-panel { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; padding: 18px 20px; }
.upload-panel p { margin-top: 4px; color: var(--ink-muted); }
.file-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.file-picker { display: flex; min-height: 42px; align-items: center; gap: 12px; padding: 5px; border: 1px dashed var(--line); border-radius: var(--radius-md); background: var(--ground); cursor: pointer; }
.file-picker-button { padding: 7px 11px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap; }
.file-name { min-width: 0; overflow: hidden; color: var(--ink-muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.file-input:focus-visible + .file-picker { outline: 2px solid var(--brand); outline-offset: 3px; }
.notice { padding: 13px 15px; border-radius: var(--radius-md); background: var(--soon-soft); color: var(--soon); }
.notice p { margin-top: 3px; }
.company-summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 22px; }
.company-summary p { color: var(--ink-muted); }
.metric-inline { display: flex; align-items: baseline; gap: 7px; white-space: nowrap; }
.metric-inline strong { font: var(--text-kpi); font-variant-numeric: tabular-nums; }
.metric-inline span { color: var(--ink-muted); }

.employee-mode .sidebar, .employee-mode .topbar { display: none; }
.employee-mode .app-shell { display: block; min-height: 100vh; }
.employee-mode .main { display: grid; min-height: 100vh; place-items: start center; }
.employee-mode .page { width: min(100% - 40px, 720px); padding-top: clamp(48px, 10vh, 100px); }
.employee-brand { margin-bottom: 48px; }
.employee-brand { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.employee-brand .brand { display: inline-flex; padding: 0; }
.employee-mode .greeting { font-size: 34px; line-height: 38px; }
.employee-mode .greeting em { font-size: 34px; line-height: 38px; }
.employee-mode .chat-layout { min-height: 56vh; }

.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: grid; gap: 8px; }
.toast { max-width: min(420px, calc(100vw - 32px)); padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-card); }
.toast[data-kind="error"] { border-color: var(--late); color: var(--late); }
.toast[data-kind="success"] { border-color: var(--brand); color: var(--brand); }
.mobile-scrim { display: none; }

@media (max-width: 1023px) {
  .app-shell { grid-template-columns: 64px minmax(0, 1fr); }
  .sidebar { width: 64px; align-items: center; padding-inline: 8px; }
  .brand { padding-inline: 0; }
  .auth-brand .brand-name { display: block; }
  .brand-name, .company-switch, .nav-label, .nav-section-title, .nav-count, .legacy-link span, .profile > span:last-child { display: none; }
  .sidebar-nav, .process-nav, .sidebar-bottom { width: 100%; }
  .nav-link { justify-content: center; padding-inline: 4px; }
  .legacy-link { justify-content: center; padding-inline: 0; }
  .profile { justify-content: center; padding-inline: 0; }
}
@media (max-width: 767px) {
  body { padding-bottom: 68px; }
  .auth-screen { grid-template-columns: 1fr; }
  .auth-intro { min-height: auto; padding: 18px 22px 22px; }
  .auth-intro-copy { padding: 38px 0 0; }
  .auth-intro-copy p { margin-bottom: 10px; font-size: 36px; }
  .auth-intro-copy > span, .auth-footnote { display: none; }
  .auth-panel { align-content: start; padding: 38px 22px 56px; }
  #logout-button { padding-inline: 9px; font-size: 12px; }
  .app-shell { display: block; min-height: calc(100vh - 68px); }
  .sidebar { position: fixed; inset: auto 0 0; display: flex; width: 100%; height: 68px; flex-direction: row; align-items: stretch; padding: 5px 8px calc(5px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); border-right: 0; background: var(--surface); overflow: visible; }
  .sidebar > .brand, .company-switch, .sidebar-bottom, .nav-section-title, .process-nav { display: none; }
  .sidebar-nav { display: flex; width: 100%; align-items: stretch; justify-content: space-around; gap: 2px; }
  .sidebar-nav > .nav-section-title { display: none; }
  .sidebar-nav > .nav-link { display: flex; flex: 1; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; min-height: 56px; padding: 4px 2px; border-radius: 10px; font-size: 11px; }
  .sidebar-nav > .nav-link:nth-of-type(n+5) { display: none; }
  .nav-link[aria-current="page"] { background: var(--brand-soft); color: var(--brand); box-shadow: none; }
  .nav-label { display: block; max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar { height: 50px; padding-inline: 16px; }
  .mobile-menu { display: grid; }
  .breadcrumbs { margin-right: auto; }
  .topbar-actions { gap: 12px; }
  .top-link span:last-child, .secure-label { display: none; }
  .page { width: min(100% - 32px, var(--content-max)); padding: 28px 0 40px; }
  .page-wide { width: min(100% - 32px, var(--content-wide)); }
  .app-alert { width: calc(100% - 32px); }
  .greeting, .greeting em { font-size: 34px; line-height: 38px; }
  .split { grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 24px; }
  .process-grid, .assistant-grid, .connector-grid { grid-template-columns: 1fr; }
  .task-row { grid-template-columns: 1fr; gap: 10px; }
  .task-row .button { justify-self: start; }
  .page-head { flex-direction: column; gap: 14px; margin-bottom: 22px; }
  .page-head-actions { width: 100%; }
  .page-head-actions .button { flex: 1; }
  .surface-pad { padding: 18px; }
  .upload-panel, .company-summary { align-items: stretch; flex-direction: column; }
  .stack { gap: 20px; }
  .ask-form { gap: 4px; }
  .ask-form .button { min-width: 44px; padding-inline: 12px; }
  .ask-form .button .button-label { display: none; }
  .chat-message { max-width: 92%; }
  .chat-layout { min-height: 0; gap: 10px; }
  .chat-messages { overflow: visible; }
  .chat-welcome { min-height: 0; gap: 8px; padding: 10px 0; }
  .chat-welcome h1 { font-size: 28px; line-height: 32px; }
  .chat-welcome p { font-size: 13px; line-height: 19px; }
  .chat-welcome .suggestions { width: 100%; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding: 2px 0 5px; }
  .chat-welcome .suggestion { flex: none; }
  .chat-gate { padding: 10px 12px; }
  .chat-gate p, .chat-gate .button { display: none; }
  .chat-compose { position: sticky; bottom: 72px; z-index: 5; padding: 4px 0; background: var(--ground); }
  .employee-mode .page { width: min(100% - 32px, 720px); }
  .employee-brand { margin-bottom: 36px; }
  .mobile-scrim:not([hidden]) { position: fixed; inset: 0; display: block; z-index: 18; background: rgba(28, 27, 25, .38); }
  .sidebar.mobile-open { z-index: 21; top: 0; bottom: auto; display: flex; width: min(82vw, 320px); height: 100dvh; flex-direction: column; align-items: stretch; padding: 18px 12px; border-top: 0; border-right: 1px solid var(--line); overflow-y: auto; }
  .sidebar.mobile-open > .brand, .sidebar.mobile-open .company-switch, .sidebar.mobile-open .sidebar-bottom, .sidebar.mobile-open .nav-section-title, .sidebar.mobile-open .process-nav { display: grid; }
  .sidebar.mobile-open .brand { display: flex; }
  .sidebar.mobile-open .brand-name, .sidebar.mobile-open .company-switch, .sidebar.mobile-open .nav-label, .sidebar.mobile-open .nav-section-title, .sidebar.mobile-open .nav-count, .sidebar.mobile-open .legacy-link span, .sidebar.mobile-open .profile > span:last-child { display: block; }
  .sidebar.mobile-open .sidebar-nav { display: grid; align-content: start; }
  .sidebar.mobile-open .nav-link { justify-content: flex-start; padding-inline: 9px; }
  .sidebar.mobile-open .process-nav { width: 100%; }
  .sidebar.mobile-open .sidebar-bottom { display: grid; margin-top: auto; }
  .sidebar.mobile-open .profile { justify-content: flex-start; padding-inline: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ===== MekorAI RH 1.0 : conversation, cartes de mise en route, tâches, réglages ===== */
.chat-message.assistant { white-space: normal; }
.chat-message p { margin: 0 0 8px; } .chat-message p:last-child { margin-bottom: 0; }
.chat-message ul, .chat-message ol { margin: 4px 0 8px; padding-left: 20px; }
.chat-message h4 { margin: 10px 0 4px; font: var(--text-card-title); }
.chat-message a { color: var(--brand); text-decoration: underline; }
.tool-step { margin: 6px 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-muted); color: var(--ink-muted); font-size: 13px; }
.tool-step summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
.tool-step summary::-webkit-details-marker { display: none; }
.tool-step pre { margin: 8px 0 0; max-height: 220px; overflow: auto; white-space: pre-wrap; font: 12px/1.5 ui-monospace, Consolas, monospace; color: var(--ink); }
.tool-step .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: none; }
.tool-step .dot.wait { background: var(--soon); animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .tool-step .dot.wait { animation: none; } }
.etapes-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 4px; color: var(--ink-muted); font-size: 13px; }
.etapes-list li { display: flex; gap: 8px; align-items: center; } .etapes-list .icon { width: 14px; height: 14px; color: var(--brand); }
.card-inline { margin-top: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--ground); display: grid; gap: 12px; }
.card-inline h3 { margin: 0; font: var(--text-card-title); }
.card-inline dl { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; margin: 0; font-size: 14px; }
.card-inline dt { color: var(--ink-muted); } .card-inline dd { margin: 0; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.choice-list { display: flex; flex-wrap: wrap; gap: 6px; }
.choice-list label { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); font-size: 13px; cursor: pointer; }
.choice-list label:has(input:checked) { border-color: var(--ink); background: var(--ink); color: var(--on-ink); }
.choice-list label:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.choice-list input { position: absolute; opacity: 0; pointer-events: none; }
.rule-check { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.rule-check input { margin-top: 4px; accent-color: var(--brand); width: 16px; height: 16px; }
.quote { margin: 6px 0 0; padding: 4px 0 4px 10px; border-left: 2px solid var(--line); color: var(--ink-muted); font-size: 13px; }
.field { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); font-size: 14px; }
textarea.field { min-height: 90px; line-height: 1.5; resize: vertical; }
.field:focus { border-color: var(--brand); outline: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid label, .form-row { display: grid; align-content: start; gap: 6px; font-size: 13px; font-weight: 600; }
.help { color: var(--ink-muted); font-size: 12px; font-weight: 400; }
.a-definir { color: var(--ink-muted); font-style: italic; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--ink-muted); font: var(--text-button); white-space: nowrap; }
.tabs button[aria-selected="true"] { border-bottom-color: var(--ink); color: var(--ink); }
.toggle { position: relative; display: inline-flex; width: 40px; height: 22px; flex: none; }
.toggle input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.toggle span { position: relative; width: 100%; height: 100%; border-radius: 999px; background: var(--line); transition: background .15s; }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: white; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle input:checked + span { background: var(--brand); } .toggle input:checked + span::after { transform: translateX(18px); }
.toggle input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.agent-card { display: grid; gap: 12px; padding: 18px; }
.agent-card .head { display: flex; gap: 12px; align-items: flex-start; }
.agent-card h3 { margin: 0; font: var(--text-card-title); } .agent-card p { margin: 0; color: var(--ink-muted); font-size: 13.5px; }
.cards-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.logo-tile { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: white; display: grid; place-items: center; overflow: hidden; flex: none; }
.logo-tile img { width: 28px; height: 28px; object-fit: contain; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font: var(--text-label); background: var(--surface-muted); color: var(--ink-muted); white-space: nowrap; }
.status-pill.ok { background: var(--brand-soft); color: var(--brand); } .status-pill.warn { background: var(--soon-soft); color: var(--soon); } .status-pill.late { background: var(--late-soft); color: var(--late); }
.drawer-scrim { position: fixed; inset: 0; background: rgba(20, 18, 14, .28); z-index: 60; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); border-left: 1px solid var(--line); z-index: 61; display: flex; flex-direction: column; box-shadow: var(--shadow-card); }
.drawer header { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.drawer header h2 { margin: 0; font: var(--text-section); }
.drawer .body { padding: 20px 22px; overflow-y: auto; flex: 1; display: grid; gap: 14px; align-content: start; }
.drawer footer { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 22px; border-top: 1px solid var(--line); }
.icon-button { display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 10px; background: none; color: var(--ink-muted); margin-left: auto; }
.icon-button:hover { background: var(--surface-muted); color: var(--ink); }
.code-box { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-muted); font: 12.5px/1.5 ui-monospace, Consolas, monospace; word-break: break-all; white-space: pre-wrap; }
.forecast { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.forecast div { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.forecast b { display: block; font: var(--text-kpi); font-size: 26px; font-variant-numeric: tabular-nums; } .forecast span { color: var(--ink-muted); font-size: 13px; }
.calm { display: grid; justify-items: start; gap: 8px; padding: 32px 28px; border-radius: var(--radius-lg); background: var(--brand-soft); }
.calm strong { font: var(--text-empty-state); color: var(--ink); }
.drop-zone { display: grid; gap: 6px; justify-items: start; padding: 16px; border: 1.5px dashed var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.drop-zone.over { border-color: var(--brand); background: var(--brand-soft); }
.conv-link { display: block; padding: 5px 9px; border-radius: var(--radius-sm); color: var(--ink-muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-link:hover, .conv-link[aria-current="page"] { background: var(--surface); color: var(--ink); }
.table { width: 100%; border-collapse: collapse; font: var(--text-table); }
.table th { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--ink-muted); font: var(--text-label); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
button.profile { width: 100%; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; cursor: pointer; border-radius: var(--radius-sm); }
button.profile:hover { background: var(--surface); }
@media (max-width: 900px) { .cards-2, .form-grid, .forecast { grid-template-columns: 1fr; } .card-inline dl { grid-template-columns: 1fr; } }
.week-count { font-size: 11px; line-height: 1.2; overflow-wrap: anywhere; }
@media (max-width: 900px) { .cards-2, .form-grid, .forecast { grid-template-columns: minmax(0, 1fr); } .forecast { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .sidebar:not(.mobile-open) .conv-link { display: none; }
  .sidebar.mobile-open .sidebar-nav > .nav-link { flex-direction: row; min-height: 38px; font-size: 14px; }
  .sidebar.mobile-open .sidebar-nav > .nav-link:nth-of-type(n+5) { display: flex; }
  .sidebar.mobile-open .nav-label { max-width: none; }
  .greeting { overflow-wrap: anywhere; }
  .chat-message { max-width: 100%; }
  .table { display: block; overflow-x: auto; }
  .drawer { width: 100vw; }
}
.stack, .stack-tight { grid-template-columns: minmax(0, 1fr); }
.stack > *, .stack-tight > * { min-width: 0; }
.week-count b { display: inline-grid; min-width: 20px; height: 20px; place-items: center; border-radius: 999px; background: var(--soon-soft); color: var(--soon); font-size: 11px; }
.metric-inline { flex-wrap: wrap; row-gap: 4px; white-space: normal; }
@media (max-width: 767px) {
  .sidebar:not(.mobile-open) .nav-count { display: none; }
  .sidebar:not(.mobile-open) .sidebar-nav > .nav-link { flex: 1 1 0; }
}
@media (max-width: 767px) {
  .toast-region { left: 16px; right: 16px; bottom: 80px; }
  .sidebar:not(.mobile-open) .sidebar-nav { gap: 0; overflow: hidden; }
  .sidebar:not(.mobile-open) .nav-label { max-width: 100%; }
}

/* ---------- Assistant : conversation de travail ---------- */
.button-quiet { border-color: transparent; color: var(--ink-muted); }
.button-quiet:hover { border-color: var(--line); color: var(--ink); }
.chat-zone.employee { width: 100%; min-height: 56vh; }
.chat-zone .chat-messages { flex: 1; display: flex; flex-direction: column; gap: 26px; padding: 12px 0 24px; overflow: visible; }

/* Accueil */
.chat-zone .chat-welcome { display: grid; justify-items: start; align-content: start; gap: 14px; min-height: 0; padding: 28px 0 8px; text-align: left; }
.chat-zone .chat-welcome h1 { margin: 0; font: 400 40px/1.1 var(--font-display); letter-spacing: -.025em; }
.chat-zone .chat-welcome h1 em { color: var(--brand); }
.chat-zone .chat-welcome > p { max-width: 60ch; margin: 0; color: var(--ink-muted); font-size: 15px; line-height: 1.6; }
.chat-zone .chat-welcome .suggestions { justify-content: flex-start; }
.chat-zone.employee .chat-welcome { justify-items: center; text-align: center; }
.chat-zone.employee .chat-welcome .suggestions { justify-content: center; }
.data-strip { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--ink-muted); font: var(--text-small); }
.data-strip span { display: inline-flex; align-items: center; gap: 6px; }
.data-strip .icon { width: 15px; height: 15px; }
.data-strip a { color: var(--brand); text-decoration: underline; }
.capacites { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; margin-top: 10px; }
.capacite { display: grid; align-content: start; gap: 2px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.capacite-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.capacite-head h2 { margin: 0; font: var(--text-card-title); }
.capacite-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: var(--brand-soft); color: var(--brand); }
.capacite-icon .icon { width: 16px; height: 16px; }
.capacite button { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink-muted); font: var(--text-small); text-align: left; }
.capacite button .icon { width: 14px; height: 14px; opacity: 0; transition: opacity .16s, translate .16s; translate: -4px 0; }
.capacite button:hover { background: var(--surface-muted); color: var(--ink); }
.capacite button:hover .icon { opacity: 1; translate: 0 0; }

/* Messages */
.msg { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
.chat-zone .chat-messages > *, .chat-zone .composer { min-width: 0; max-width: 100%; }
.msg-user { justify-items: end; }
.msg-bubble { max-width: min(86%, 620px); padding: 11px 15px; border-radius: 18px 18px 4px 18px; background: var(--surface-muted); font: var(--text-chat); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-pieces { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 86%; }
.msg-text { font: var(--text-chat); overflow-wrap: anywhere; }
.msg-text p { margin: 0 0 10px; }
.msg-text p:last-child { margin-bottom: 0; }
.msg-text ul, .msg-text ol { margin: 2px 0 10px; padding-left: 22px; }
.msg-text li { margin: 3px 0; }
.msg-text h4 { margin: 16px 0 6px; font: var(--text-card-title); font-size: 16px; }
.msg-text h4:first-child { margin-top: 0; }
.msg-text a { color: var(--brand); text-decoration: underline; }
.msg-text code { padding: 1px 5px; border-radius: 5px; background: var(--surface-muted); font: 13px/1.5 ui-monospace, Consolas, monospace; }
.msg-text hr { margin: 14px 0; border: 0; border-top: 1px solid var(--line); }
.msg-text .md-source { color: var(--ink-muted); font: var(--text-small); }
.msg-text .table-wrap { margin: 6px 0 12px; }
.msg-sources { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.msg-sources .label { margin-right: 2px; }
.msg-sources .citation { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); color: var(--ink-muted); font: var(--text-small); font-size: 12px; }
.msg-sources .citation .icon { width: 13px; height: 13px; color: var(--brand); }
.msg-suites { display: grid; gap: 8px; }
.msg-suites p { margin: 0; font-weight: 600; }
.msg-suites .suggestions { justify-content: flex-start; margin: 0; }
.msg-suites .suggestion { display: inline-flex; max-width: 100%; align-items: center; gap: 6px; color: var(--ink); white-space: normal; text-align: left; }
.msg-suites .suggestion .icon { flex: none; }
.msg-suites .suggestion .icon { width: 13px; height: 13px; color: var(--brand); }
.msg-actions { display: flex; gap: 2px; margin-top: -4px; }
.msg-actions .icon-button { width: 30px; height: 30px; margin: 0; }
.msg-actions .icon { width: 15px; height: 15px; }

/* Fil de travail */
.work summary::-webkit-details-marker { display: none; }
.work-summary { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-labels { color: var(--ink-muted); }
.work[open] .work-chevron { rotate: 90deg; }
.work-state.warn { background: var(--soon-soft); color: var(--soon); }
.work-state.live, .spinner { border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; background: none; animation: tourne .8s linear infinite; }
.spinner { display: inline-block; width: 14px; height: 14px; flex: none; }
@keyframes tourne { to { rotate: 360deg; } }
.step-result { display: block; color: var(--ink-muted); }
.work-live { display: flex; align-items: center; gap: 10px; color: var(--ink-muted); font: var(--text-small); }

/* Livrables */
.deliv { display: grid; gap: 12px; min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card); transition: border-color .3s; }
.deliv.flash { border-color: var(--brand); }
.deliv-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.deliv-icon { display: grid; width: 34px; height: 34px; flex: none; place-items: center; border-radius: 10px; background: var(--surface-muted); color: var(--ink); }
.deliv-icon .icon { width: 17px; height: 17px; }
.deliv-ext { background: var(--admin); color: var(--admin-ink); font: 700 10px/1 var(--font-sans); letter-spacing: .04em; }
.deliv-title { display: grid; min-width: 0; flex: 1; gap: 1px; }
.deliv-title b { overflow: hidden; font: var(--text-card-title); text-overflow: ellipsis; white-space: nowrap; }
.deliv-actions { display: flex; flex: none; align-items: center; gap: 4px; }
.deliv-actions .icon-button { margin: 0; }
.deliv-line { display: flex; align-items: center; gap: 12px; padding: 10px 14px; box-shadow: none; }
.deliv-text { margin: 0; }
.deliv-note { margin: 0; color: var(--ink-muted); font: var(--text-small); }
.deliv-more { justify-self: start; padding: 0; border: 0; background: none; color: var(--brand); font: var(--text-small); font-weight: 600; }
.table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); }
.data-table { width: 100%; border-collapse: collapse; font: var(--text-small); font-variant-numeric: tabular-nums; }
.data-table th { padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface-muted); color: var(--ink-muted); font: var(--text-label); text-align: left; white-space: nowrap; }
.data-table td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td.num { text-align: right; white-space: nowrap; }
.data-table tbody tr:hover { background: var(--ground); }
.data-table tr.total td { border-top: 1px solid var(--ink-muted); font-weight: 600; }
.mail-meta { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; margin: 0; font: var(--text-small); }
.mail-meta dt { color: var(--ink-muted); }
.mail-meta dd { margin: 0; overflow-wrap: anywhere; }
.mail-body, .doc-preview { max-height: 220px; padding: 12px 14px; overflow: auto; border-radius: var(--radius-md); background: var(--ground); font: var(--text-body); white-space: pre-wrap; overflow-wrap: anywhere; }
.doc-preview { white-space: normal; }
.doc-preview p { margin: 0 0 6px; }
.doc-preview h4 { margin: 6px 0; font: var(--text-card-title); }

/* Compositeur */
.composer-pieces { display: flex; flex-wrap: wrap; gap: 6px; }
.composer-pieces:empty { display: none; }
.piece { display: inline-flex; max-width: 100%; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--ground); font: var(--text-small); }
.piece > .icon { width: 16px; height: 16px; color: var(--brand); }
.piece.lecture > .icon { color: var(--soon); animation: pulse 1s infinite alternate; }
.piece.erreur { border-color: var(--late-soft); background: var(--late-soft); }
.piece.erreur > .icon { color: var(--late); }
.piece-text { display: grid; min-width: 0; }
.piece-text b, .piece-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.piece-text small { color: var(--ink-muted); font-size: 12px; }
.msg-pieces .piece { padding-right: 10px; }
.piece-x { display: grid; width: 24px; height: 24px; place-items: center; border: 0; border-radius: 7px; background: none; color: var(--ink-muted); }
.piece-x:hover { background: var(--surface-muted); color: var(--ink); }
.piece-x .icon { width: 13px; height: 13px; }
.drop-veil { position: absolute; inset: 0; z-index: 8; display: none; place-content: center; justify-items: center; gap: 6px; border: 2px dashed var(--brand); border-radius: var(--radius-lg); background: var(--ground); color: var(--ink-muted); text-align: center; }
.drop-veil b { color: var(--ink); font: var(--text-empty-state); }
.drop-veil .icon { width: 28px; height: 28px; color: var(--brand); }
.chat-zone.dragging .drop-veil { display: grid; }

/* Panneau de travail */

@media (max-width: 767px) {
  .chat-zone { min-height: calc(100vh - var(--topbar-height) - 140px); }
  .capacites { grid-template-columns: minmax(0, 1fr); }
  .chat-zone .chat-welcome { padding-top: 8px; }
  .chat-zone .chat-welcome h1 { font-size: 30px; line-height: 34px; }
  .msg-assistant { padding-left: 0; }
  .msg-assistant .msg-head { margin-left: 0; }
  .msg-bubble { max-width: 92%; }
  .deliv-head { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .work-state.live, .spinner, .work-steps li.wait .step-dot, .piece.lecture > .icon { animation: none; } }

/* ---------- Coque : menu repliable, contenu dans un panneau posé sur le fond du menu ---------- */
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 36px; }
.sidebar-head .brand { min-width: 0; padding: 2px 6px; }
.sidebar-toggle { display: grid; width: 30px; height: 30px; flex: none; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--ink-muted); transition: background-color .15s, color .15s; }
.sidebar-toggle:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); }
.sidebar-toggle .icon { width: 17px; height: 17px; }
.nav-link { min-height: 34px; padding: 6px 10px; border-radius: 8px; font-size: 14px; }
.nav-link:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.nav-link[aria-current="page"] { background: color-mix(in srgb, var(--ink) 7%, transparent); box-shadow: none; color: var(--ink); }
.nav-icon .icon { width: 17px; height: 17px; }
.conv-link { padding: 6px 10px; border-radius: 8px; font-size: 13px; }
.conv-link:hover, .conv-link[aria-current="page"] { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.company-switch { min-height: 0; padding: 7px 10px; border-color: transparent; background: color-mix(in srgb, var(--surface) 55%, transparent); }

@media (min-width: 768px) {
  body { background: var(--surface-muted); }
  .app-shell { height: 100dvh; min-height: 0; transition: grid-template-columns .24s cubic-bezier(.32, .72, 0, 1); }
  .sidebar { height: 100dvh; gap: 14px; padding: 10px 10px 12px; border-right: 0; background: transparent; }
  .main { height: calc(100dvh - 16px); margin: 8px 8px 8px 0; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 14px; background: var(--ground); box-shadow: 0 1px 2px rgba(28, 27, 25, .04); }
  .topbar { height: 52px; padding: 0 20px 0 24px; background: var(--ground); }
}
@media (min-width: 1024px) {
  body.nav-reduite .app-shell { grid-template-columns: 60px minmax(0, 1fr); }
  body.nav-reduite .sidebar { width: 60px; align-items: center; padding-inline: 8px; }
  body.nav-reduite .sidebar-head { flex-direction: column; gap: 8px; }
  body.nav-reduite .sidebar-head .brand { padding: 2px 0; }
  body.nav-reduite :is(.brand-name, .company-switch, .nav-label, .nav-section-title, .nav-count, .conv-link, .legacy-link span, .profile > span:last-child) { display: none; }
  body.nav-reduite :is(.sidebar-nav, .process-nav, .sidebar-bottom) { width: 100%; justify-items: center; }
  body.nav-reduite .nav-link { width: 40px; justify-content: center; padding: 0; }
  body.nav-reduite .profile { justify-content: center; padding-inline: 0; }
}
@media (min-width: 768px) and (max-width: 1023px) { .sidebar-toggle { display: none; } .sidebar-head { justify-content: center; } }

/* Fil d'Ariane et menu de la conversation */
.breadcrumbs { display: flex; min-width: 0; align-items: center; gap: 6px; color: var(--ink-muted); font: 400 14px/20px var(--font-sans); }
.breadcrumbs a:hover { color: var(--ink); }
.crumb-sep { color: var(--ink-muted); opacity: .5; }
.crumb-current { display: inline-flex; min-width: 0; align-items: center; gap: 4px; color: var(--ink); font-weight: 500; }
button.crumb-current { max-width: min(52vw, 520px); padding: 4px 8px; border: 0; border-radius: 8px; background: none; font: inherit; font-weight: 500; }
button.crumb-current:hover, button.crumb-current[aria-expanded="true"] { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.crumb-current .icon { width: 15px; height: 15px; flex: none; color: var(--ink-muted); }
.crumb-menu-wrap { position: relative; display: inline-flex; min-width: 0; }
.crumb-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; display: grid; min-width: 190px; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-card); animation: pop .14s ease-out; }
.menu-pop button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font-size: 14px; text-align: left; }
.menu-pop button:hover { background: var(--surface-muted); }
.menu-pop button .icon { width: 16px; height: 16px; color: var(--ink-muted); }
.menu-pop .danger, .menu-pop .danger .icon { color: var(--late); }
@keyframes pop { from { opacity: 0; translate: 0 -4px; } to { opacity: 1; translate: 0 0; } }
.topbar-actions .button-small .icon { width: 15px; height: 15px; }

/* ---------- Assistant : une seule colonne ---------- */
.page.page-chat { width: min(100% - 48px, 768px); padding: 0; animation: none; }
.chat-zone { position: relative; display: flex; width: 100%; min-height: calc(100dvh - 16px - 54px); margin: 0; flex-direction: column; }
.chat-zone.employee { min-height: 56vh; }
.chat-thread .chat-messages { flex: 1; display: flex; flex-direction: column; gap: 28px; padding: 32px 0 28px; }
.composer-dock { position: sticky; bottom: 0; z-index: 6; padding: 0 0 20px; background: var(--ground); }

/* Accueil */
.chat-home { justify-content: center; gap: 16px; padding: 40px 0 64px; }
.chat-home-head { display: grid; justify-items: start; gap: 14px; margin-bottom: 6px; }
.chat-home-mark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.chat-home-mark .icon { width: 19px; height: 19px; }
.chat-home h1 { margin: 0; font: 400 34px/1.15 var(--font-display); letter-spacing: -.02em; }
.chat-home h1 em { color: var(--brand); }
.chat-home .data-strip { padding: 0 4px; }
.chat-home .suggestions { justify-content: flex-start; margin: 0; }
.chat-home-sub { margin: 22px 0 0; color: var(--ink); font: 600 14px/20px var(--font-sans); }
.chat-home .capacites { margin-top: 0; }
.capacite { gap: 0; padding: 14px; border-radius: 14px; transition: box-shadow .15s, border-color .15s; }
.capacite:hover { border-color: color-mix(in srgb, var(--ink) 18%, var(--line)); box-shadow: var(--shadow-card); }
.capacite-head { margin-bottom: 6px; }
.capacite-head h3 { margin: 0; font: var(--text-card-title); }
.capacite button { padding: 7px 8px; }

/* Zone de saisie */
.composer { position: relative; display: grid; gap: 10px; padding: 14px 12px 10px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-card); transition: border-color .15s; }
.composer:focus-within { border-color: color-mix(in srgb, var(--ink) 28%, var(--line)); }
.composer textarea { width: 100%; min-height: 24px; max-height: 220px; padding: 0; border: 0; outline: 0; resize: none; background: transparent; font: var(--text-chat); }
.composer textarea::placeholder { color: var(--ink-muted); opacity: 1; }
.composer-bar { display: flex; align-items: center; gap: 8px; }
.composer-tool { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink-muted); cursor: pointer; transition: color .15s, border-color .15s; }
.composer-tool:hover { border-color: var(--ink-muted); color: var(--ink); }
.composer-tool .icon { width: 16px; height: 16px; }
.composer-send { display: grid; width: 32px; height: 32px; flex: none; place-items: center; margin-left: auto; border: 0; border-radius: 8px; background: var(--ink); color: var(--on-ink); transition: opacity .15s, background-color .15s; }
.composer-send:hover { background: var(--brand); color: white; }
.composer-send .icon { width: 16px; height: 16px; stroke-width: 2; }
.composer.vide .composer-send:not(.stop) { opacity: .3; }
.composer-send.stop .icon { width: 13px; height: 13px; fill: currentColor; }

/* Messages : texte nu, étapes discrètes */
.msg-bubble { padding: 10px 14px; border-radius: 14px; background: var(--brand-soft); color: var(--ink); }
.msg-assistant { padding-left: 0; }
.work { border: 0; background: none; }
.work summary { display: inline-flex; max-width: 100%; align-items: center; gap: 8px; padding: 2px 0; cursor: pointer; list-style: none; color: var(--ink-muted); font: var(--text-body); transition: color .15s; }
.work summary::-webkit-details-marker { display: none; }
.work summary:hover { color: var(--ink); }
.work-state { display: grid; width: 16px; height: 16px; flex: none; place-items: center; color: var(--ink-muted); }
.work-state .icon { width: 15px; height: 15px; }
.work-state.done .icon { color: var(--brand); }
.work-state.live { width: 14px; height: 14px; }
.work-state.live + .work-summary, .work-live > span:last-child { animation: respire 1.6s ease-in-out infinite; }
@keyframes respire { 50% { opacity: .45; } }
.work .work-chevron { width: 14px; height: 14px; flex: none; color: var(--ink-muted); transition: rotate .15s; }
.work-labels { opacity: .8; }
.work-steps { display: grid; gap: 6px; margin: 8px 0 4px 7px; padding: 0 0 0 17px; list-style: none; border-left: 1px solid var(--line); }
.work-steps li { display: flex; gap: 10px; font: var(--text-small); }
.step-dot { width: 6px; height: 6px; margin-top: 7px; flex: none; border-radius: 50%; background: var(--brand); }
.work-steps li.wait .step-dot { background: var(--soon); }
.work-steps li.ko .step-dot { background: var(--late); }
.work-steps b { font-weight: 600; }
.work-live { font: var(--text-body); }
.deliv { border-radius: 14px; }

@media (max-width: 767px) {
  .sidebar-head { display: none; }
  .sidebar.mobile-open .sidebar-head { display: flex; }
  .sidebar.mobile-open .sidebar-toggle { display: none; }
  .breadcrumbs { font-size: 13px; }
  button.crumb-current { max-width: 48vw; }
  .page.page-chat { width: calc(100% - 32px); }
  .chat-zone { min-height: calc(100dvh - 50px - 68px); }
  .composer-dock { bottom: 68px; padding-bottom: 10px; }
  .chat-home { justify-content: flex-start; padding: 24px 0 32px; }
  .chat-home h1 { font-size: 28px; line-height: 32px; }
  .topbar-actions .button-small { width: 34px; padding: 0; }
  .topbar-actions .button-small .button-label, .crumb-parent, .crumb-sep { display: none; }
}
@media (prefers-reduced-motion: reduce) { .work-state.live, .spinner, .work-state.live + .work-summary, .work-live > span:last-child, .piece.lecture > .icon { animation: none; } }

/* ---------- Animal fétiche et démo ---------- */
button.chat-home-mark { border: 0; cursor: pointer; transition: transform .2s cubic-bezier(.32, .72, 0, 1), background-color .15s; }
button.chat-home-mark:hover { transform: rotate(-6deg) scale(1.06); }
.animal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.animal-choix { display: grid; justify-items: center; gap: 8px; padding: 14px 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 13px; transition: border-color .15s, background-color .15s, transform .15s; }
.animal-choix .icon { width: 28px; height: 28px; stroke-width: 1.5; color: var(--brand); }
.animal-choix:hover { border-color: var(--ink-muted); transform: translateY(-1px); }
.animal-choix[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.animal-reglage { display: flex; align-items: center; gap: 14px; }
.animal-reglage > div { flex: 1; }
.animal-actuel { display: grid; width: 44px; height: 44px; flex: none; place-items: center; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.animal-actuel .icon { width: 24px; height: 24px; }
.work-animal { display: grid; width: 20px; height: 20px; place-items: center; color: var(--brand); animation: trotte 1.1s ease-in-out infinite; }
.work-animal .icon { width: 18px; height: 18px; }
@keyframes trotte { 0%, 100% { translate: 0 0; rotate: 0deg; } 25% { translate: 0 -3px; rotate: -6deg; } 50% { translate: 0 0; rotate: 0deg; } 75% { translate: 0 -2px; rotate: 5deg; } }
.app-alert:not([hidden]) { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: min(100% - 48px, var(--content-wide)); margin: 14px auto 0; padding: 10px 10px 10px 16px; border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--line)); border-radius: 12px; background: var(--brand-soft); color: var(--ink); font-size: 13px; }
.auth-demo { display: grid; gap: 16px; }
.auth-demo-list { display: grid; gap: 8px; margin: 0; padding: 0 0 0 18px; color: var(--ink-muted); font-size: 14px; line-height: 1.5; }
@media (max-width: 767px) { .app-alert:not([hidden]) { width: calc(100% - 32px); flex-direction: column; align-items: flex-start; } }
@media (prefers-reduced-motion: reduce) { .work-animal, button.chat-home-mark { animation: none; transition: none; } }

/* ---------- Éditeur : le document à côté de la conversation ---------- */
.editeur { position: fixed; z-index: 40; display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.editeur[hidden] { display: none; }
@media (min-width: 1024px) {
  body.editeur-ouvert .main { margin-right: calc(min(50vw, 880px) + 8px); }
  .editeur { top: 8px; right: 8px; bottom: 8px; width: min(50vw - 16px, 872px); border-radius: 14px; box-shadow: 0 1px 2px rgba(28, 27, 25, .04); animation: glisse .22s cubic-bezier(.32, .72, 0, 1); }
  body.editeur-ouvert .page.page-chat { width: min(100% - 40px, 720px); }
}
@media (max-width: 1023px) { .editeur { inset: 0; z-index: 70; } .ed-plein-bouton { display: none; } }
/* Plein écran : le document prend toute la largeur, la conversation reste derrière (Échap ou le bouton pour revenir). */
@media (min-width: 1024px) { body.editeur-plein .editeur { left: 8px; width: auto; z-index: 70; box-shadow: 0 8px 40px rgba(28, 27, 25, .18); } body.editeur-plein .ed-page { max-width: 900px; } }
/* Animations en cours : calées sur une horloge commune (voir caler() dans app.js). */
.work-state.live, .spinner, .work-animal, .work-live > span:last-child, .work-state.live + .work-summary, .work-steps li.wait .step-dot { animation-delay: var(--horloge, 0s); }
@keyframes glisse { from { opacity: 0; translate: 16px 0; } to { opacity: 1; translate: 0 0; } }
.ed-tete { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); }
.ed-titre { display: grid; min-width: 0; flex: 1; }
.ed-titre input { min-width: 0; padding: 2px 6px; margin-left: -6px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--ink); font: var(--text-card-title); text-overflow: ellipsis; }
.ed-titre input:hover { border-color: var(--line); }
.ed-titre input:focus { border-color: var(--brand); outline: none; }
.ed-etat { color: var(--ink-muted); font: var(--text-small); }
.ed-etat[data-etat="modifie"]::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--soon); vertical-align: 1px; }
.ed-actions { display: flex; flex: none; align-items: center; gap: 4px; }
.ed-actions .icon-button { margin: 0; }
.ed-bascule { display: inline-flex; padding: 2px; margin-right: 4px; border-radius: 9px; background: var(--surface-muted); }
.ed-bascule button { padding: 4px 10px; border: 0; border-radius: 7px; background: none; color: var(--ink-muted); font-size: 13px; }
.ed-bascule button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(28, 27, 25, .08); }
.ed-barre { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--ground); }
.ed-outil { display: inline-flex; min-height: 30px; align-items: center; gap: 5px; padding: 4px 9px; border: 0; border-radius: 7px; background: none; color: var(--ink); font-size: 13px; }
.ed-outil:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.ed-outil .icon { width: 15px; height: 15px; color: var(--ink-muted); }
.ed-carre { width: 30px; justify-content: center; padding: 0; font-size: 14px; }
.ed-sep { width: 1px; height: 18px; margin: 0 5px; background: var(--line); }
.ed-note { margin: 0; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--brand-soft); color: var(--ink); font: var(--text-small); }
.ed-corps { flex: 1; min-height: 0; overflow: auto; background: var(--surface-muted); }
.ed-page { box-sizing: border-box; width: min(100% - 32px, 720px); min-height: calc(100% - 32px); margin: 16px auto; padding: 48px 56px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); font: 15px/1.65 var(--font-sans); outline: none; box-shadow: var(--shadow-card); caret-color: var(--brand); }
.ed-page:focus { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.ed-page h1 { margin: 0 0 14px; font: 400 28px/1.2 var(--font-display); letter-spacing: -.01em; }
.ed-page h2 { margin: 22px 0 8px; font: 600 18px/1.35 var(--font-sans); }
.ed-page h3 { margin: 18px 0 6px; font: 600 15px/1.4 var(--font-sans); }
.ed-page p { margin: 0 0 10px; }
.ed-page ul, .ed-page ol { margin: 0 0 10px; padding-left: 22px; }
.ed-page li { margin: 2px 0; }
.ed-page table { width: 100%; margin: 6px 0 14px; border-collapse: collapse; font-size: 14px; }
.ed-page th, .ed-page td { padding: 6px 8px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.ed-page th { background: var(--surface-muted); font-weight: 600; }
.ed-page a { color: var(--brand); }
.ed-surligne { border-radius: 4px; background: color-mix(in srgb, var(--soon) 28%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--soon) 28%, transparent); transition: background-color 1s, box-shadow 1s; }
.ed-pdf { display: block; width: 100%; height: 100%; border: 0; background: var(--surface-muted); }
.ed-chargement { display: grid; gap: 12px; padding: 24px; }
.ed-vide { display: grid; justify-items: start; gap: 10px; padding: 24px; }
@media (max-width: 767px) { .ed-barre { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .ed-outil { flex: none; } .ed-page { width: 100%; margin: 0; padding: 24px 18px; border: 0; border-radius: 0; box-shadow: none; } .ed-outil:not(.ed-carre) { padding: 4px 7px; } }

/* La grille (Excel) */
.ed-corps-grille { background: var(--surface); }
.ed-grille-wrap { min-width: max-content; }
.ed-grille { border-collapse: separate; border-spacing: 0; font: 13px/1.35 var(--font-sans); font-variant-numeric: tabular-nums; }
.ed-grille th { position: sticky; z-index: 1; padding: 4px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-muted); color: var(--ink-muted); font-weight: 500; font-size: 12px; text-align: center; }
.ed-grille thead th { top: 0; min-width: 96px; }
.ed-grille tbody th { left: 0; min-width: 40px; }
.ed-grille .ed-coin { left: 0; z-index: 2; min-width: 40px; }
.ed-grille td { min-width: 96px; max-width: 320px; height: 28px; padding: 4px 8px; overflow: hidden; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap; text-overflow: ellipsis; outline: none; cursor: cell; }
.ed-grille td:focus { position: relative; z-index: 1; overflow: visible; box-shadow: inset 0 0 0 2px var(--brand); white-space: pre-wrap; cursor: text; background: var(--surface); }
.ed-grille td.num { text-align: right; }
.ed-grille td.formule { color: var(--brand); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.ed-grille tr.ed-entete td { background: color-mix(in srgb, var(--surface-muted) 55%, var(--surface)); font-weight: 600; }
.ed-onglets { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px 10px; border-top: 1px solid var(--line); background: var(--ground); }
.ed-onglets button { display: inline-flex; min-height: 28px; align-items: center; padding: 3px 12px; border: 0; border-radius: 7px; background: none; color: var(--ink-muted); font-size: 13px; }
.ed-onglets button[aria-selected="true"] { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: 0 1px 2px rgba(28, 27, 25, .08); }
.ed-onglets button:hover { color: var(--ink); }
.ed-onglets button .icon { width: 15px; height: 15px; }
.ed-onglets .small { margin-left: auto; }

/* Liens et sources cliquables */
.lien-doc { display: inline; padding: 0; border: 0; background: none; color: var(--brand); font: inherit; font-weight: 500; text-align: left; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--brand) 35%, transparent); text-underline-offset: 2px; cursor: pointer; }
.lien-doc:hover { text-decoration-color: currentColor; }
.doc-ligne { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.doc-ligne .icon { width: 15px; height: 15px; flex: none; }
.doc-ligne:hover span { text-decoration: underline; }
.msg-text a { color: var(--brand); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--brand) 35%, transparent); text-underline-offset: 2px; }
.msg-text a:hover { text-decoration-color: currentColor; }
.icon.lien-externe { width: 12px; height: 12px; margin-left: 3px; vertical-align: -1px; opacity: .7; }
.citation-lien { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); cursor: pointer; text-decoration: none; transition: border-color .15s, background-color .15s; }
button.citation-lien { font: var(--text-small); }
.citation-lien:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); background: var(--brand-soft); }
.deliv-fichier.ouvert { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.piece-ouvert { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); background: var(--brand-soft); }

/* Pastilles de processus des documents */
.choix-processus { position: relative; display: inline-block; }
.pastille-choix { gap: 4px; padding-right: 7px; border: 0; cursor: pointer; transition: filter .15s, box-shadow .15s; }
.pastille-choix:hover, .pastille-choix[aria-expanded="true"] { filter: brightness(.97); box-shadow: 0 0 0 2px color-mix(in srgb, var(--domain-ink, var(--ink)) 18%, transparent); }
.pastille-choix .icon { width: 13px; height: 13px; opacity: .7; }
.menu-processus { min-width: 240px; }
.menu-processus button { justify-content: space-between; }
.menu-processus button .icon { color: var(--brand); }
.pastille-perso { display: inline-block; padding: 0 7px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--soon) 22%, transparent); color: var(--ink); font-size: 12px; }
.surface:has(> .table-docs) { overflow-x: auto; }
.table-docs td:first-child { min-width: 220px; }
body.editeur-ouvert .tabs { overflow-x: auto; scrollbar-width: none; }
.doc-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.doc-actions .icon-button { margin: 0; }

/* Fiche de l'entreprise et reprise de la mise en route */
.logo-reglage { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; }
.logo-reglage > div { flex: 1; min-width: 180px; }
.logo-reglage p { margin: 2px 0 0; }
.logo-apercu { display: grid; width: 96px; height: 56px; flex: none; place-items: center; overflow: hidden; border-radius: 8px; background: var(--surface-muted); color: var(--ink-muted); }
.logo-apercu img { max-width: 88px; max-height: 48px; object-fit: contain; }
.ed-image { display: grid; justify-items: center; gap: 12px; padding: 24px; }
.ed-image img { max-width: 100%; max-height: 70vh; border-radius: 8px; background: repeating-conic-gradient(#0000000d 0 25%, transparent 0 50%) 0 0 / 16px 16px; box-shadow: var(--shadow-card); }
.ent-recherche { display: flex; gap: 8px; }
.ent-recherche .field { flex: 1; }
.ent-resultats { display: grid; gap: 6px; }
.ent-resultats:empty { display: none; }
.ent-resultat { display: grid; gap: 1px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); text-align: left; }
.ent-resultat:hover { border-color: var(--brand); background: var(--brand-soft); }
.reprise { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.reprise .small { margin-right: 4px; }
@media (max-width: 767px) { .ent-recherche { flex-direction: column; } }

/* ---------- Bibliothèque MekorAI (pages de catégorie) ---------- */
.bib-avancement { display: grid; gap: 4px; min-width: 190px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.bib-avancement b { font: var(--text-kpi); font-size: 26px; font-variant-numeric: tabular-nums; } .bib-avancement b span { color: var(--ink-muted); font-size: 15px; }
.barre { display: block; height: 6px; border-radius: var(--radius-pill); background: var(--surface-muted); overflow: hidden; } .barre i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.kpi { display: grid; gap: 4px; align-content: start; padding: 13px 15px; border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.kpi b { font: var(--text-kpi); font-size: 22px; font-variant-numeric: tabular-nums; line-height: 1.15; } .kpi .small { color: var(--ink-muted); }
.kpi[data-ton="ok"] { border-left-color: var(--brand); } .kpi[data-ton="attention"] { border-left-color: var(--soon); } .kpi[data-ton="alerte"] { border-left-color: var(--late); }
.kpi[data-ton="alerte"] b { color: var(--late); }
.bib-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.bib-carte { display: flex; flex-direction: column; gap: 9px; padding: 16px 18px; }
.bib-carte h3 { margin: 0; font: var(--text-card-title); } .bib-carte p { margin: 0; color: var(--ink-muted); font-size: 13.5px; }
.bib-carte .card-actions { margin-top: auto; padding-top: 4px; flex-wrap: wrap; }
.bib-carte[data-statut="non_concerne"] { opacity: .62; }
.bib-tete { display: flex; align-items: center; gap: 8px; } .bib-tete .status-pill { margin-left: auto; }
.bib-genre { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-muted); font: var(--text-label); } .bib-genre .icon { width: 15px; height: 15px; }
.bib-vedette { color: var(--soon); font-size: 15px; line-height: 1; }
.bib-carte .bib-contexte { display: flex; gap: 7px; align-items: flex-start; padding: 7px 10px; border-radius: var(--radius-sm); background: var(--surface-muted); color: var(--ink); font-size: 13px; } .bib-contexte .icon { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--brand); }
.bib-progres { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.bib-carte .bib-detail { font-size: 12.5px; }
.bib-theme h3 { margin: 6px 0 4px; font: var(--text-card-title); font-size: 14px; }
.bib-point { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; } .bib-point:last-child { border-bottom: 0; }
.bib-point input { margin-top: 3px; flex: none; accent-color: var(--brand); } .bib-point > span { display: grid; gap: 2px; } .bib-point.auto { cursor: default; }
.bib-verif { display: inline-flex; gap: 5px; align-items: center; color: var(--brand); } .bib-verif .icon { width: 13px; height: 13px; }
.page-head:has(.bib-avancement) { flex-wrap: wrap; }
@media (max-width: 767px) { .bib-avancement { width: 100%; } .bib-grille { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Tableur : barre de formule, résultats, graphiques ---------- */
:root { --serie-1: #1e6b52; --serie-2: #3b6fb6; --serie-3: #b9801a; --serie-4: #8a5cc2; --serie-5: #c4573a; --serie-6: #2b8f8c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --serie-1: #78d5b1; --serie-2: #8ab4f0; --serie-3: #e8b65a; --serie-4: #c3a2ee; --serie-5: #f09a7f; --serie-6: #6fd0cc; } }
:root[data-theme="dark"] { --serie-1: #78d5b1; --serie-2: #8ab4f0; --serie-3: #e8b65a; --serie-4: #c3a2ee; --serie-5: #f09a7f; --serie-6: #6fd0cc; }
.ed-fx { position: sticky; top: 0; left: 0; z-index: 3; display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 4px 12px; border-bottom: 1px solid var(--line); background: var(--surface); font-size: 13px; }
.ed-fx b { min-width: 44px; color: var(--ink-muted); font: var(--text-label); } .ed-fx-icone { color: var(--ink-muted); font-style: italic; font-family: Georgia, serif; }
#ed-fx-val { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.ed-grille td.formule { color: var(--ink); font-family: inherit; font-size: inherit; background: color-mix(in srgb, var(--brand) 4%, transparent); }
.ed-grille td.formule:focus { color: var(--brand); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.ed-grille td.erreur { color: var(--late); }
.ed-graphiques { position: sticky; left: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; padding: 14px; border-bottom: 1px solid var(--line); background: var(--ground); width: min(100%, var(--largeur-panneau, 100%)); box-sizing: border-box; }
.ed-graphique { margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.ed-graphique figcaption { margin-bottom: 6px; font: var(--text-card-title); font-size: 14px; }
.ed-graphique svg { display: block; width: 100%; height: auto; }
.gr-grille { stroke: var(--line); stroke-width: 1; } .gr-axe { fill: var(--ink-muted); font-size: 13px; font-family: var(--font-sans); }
.gr-legende { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; color: var(--ink-muted); font-size: 12px; } .gr-legende i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }
body.editeur-plein .ed-page { margin-inline: auto; }

/* ---------- Assistants programmés ---------- */
.agent-cliquable { cursor: pointer; transition: border-color .15s, box-shadow .15s; } .agent-cliquable:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); box-shadow: var(--shadow-card); }
.agent-cliquable:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.agent-card .task-meta .icon { width: 14px; height: 14px; vertical-align: -2px; }
.msg-programme { display: inline-flex; align-self: flex-end; align-items: center; gap: 6px; margin-bottom: 4px; color: var(--ink-muted); font: var(--text-label); } .msg-programme .icon { width: 14px; height: 14px; color: var(--brand); }

/* ---------- Menu de gauche : fixe ; seule la liste des conversations défile ---------- */
.sidebar { overflow: hidden; }
.sidebar-nav { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; gap: 3px; }
.sidebar-nav > * { flex: none; }
.sidebar-nav > .nav-conversations { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 1px; margin-right: -6px; padding-right: 6px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--ink) 18%, transparent) transparent; }
.nav-conversations .conv-link { flex: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sidebar-bottom { flex: none; }
/* L'entreprise : une carte lisible, cliquable, qui ouvre sa fiche */
.company-switch { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); font: inherit; text-align: left; white-space: normal; cursor: pointer; flex: none; transition: border-color .15s, box-shadow .15s; }
.company-switch:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); box-shadow: 0 1px 3px rgba(28, 27, 25, .06); }
.company-switch:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.company-texte { display: grid; min-width: 0; flex: 1; line-height: 1.25; }
.company-texte strong, .company-texte small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.company-texte strong { color: var(--ink); font-size: 13.5px; font-weight: 600; } .company-texte small { color: var(--ink-muted); font-size: 12px; }
.company-switch > .icon { width: 15px; height: 15px; flex: none; color: var(--ink-muted); }
.company-initiale, .company-logo { display: grid; width: 28px; height: 28px; flex: none; place-items: center; border-radius: 8px; }
.company-initiale { background: var(--brand-soft); color: var(--brand); font: 600 14px/1 var(--font-sans); }
.company-logo { object-fit: contain; background: var(--surface); }
@media (min-width: 1024px) { body.nav-reduite .nav-conversations { display: none; } }
@media (max-width: 767px) { .sidebar { overflow: visible; } .sidebar:not(.mobile-open) .nav-conversations { display: none; } .sidebar.mobile-open { overflow-y: auto; } }
/* Écran peu haut : le haut (marque, entreprise) et le bas (règles, profil) restent fixes ; les conversations gardent quelques lignes,
   et seulement si rien d'autre ne tient, la partie centrale défile. */

/* ---------- Menu de gauche compact : rien ne défile sauf les conversations ---------- */
@media (min-width: 768px) {
  .sidebar { gap: 8px; padding: 10px 8px 10px; overflow: hidden; }
  .sidebar-nav { overflow: hidden; gap: 1px; }
  .sidebar-nav .nav-link, .sidebar-bottom .nav-link { min-height: 30px; padding: 4px 9px; gap: 9px; font-size: 13.5px; }
  .sidebar-nav .nav-icon .icon { width: 16px; height: 16px; }
  .process-nav { gap: 1px; }
  .process-nav .domain-tile { width: 22px; height: 22px; border-radius: 6px; } .process-nav .domain-tile .icon { width: 13px; height: 13px; }
  .nav-section-title { padding: 8px 9px 3px; font-size: 11px; letter-spacing: .02em; }
  .sidebar-nav > .nav-conversations { min-height: 0; }
  .conv-link { padding: 4px 9px; font-size: 12.5px; line-height: 1.35; }
  .sidebar-bottom { gap: 1px; padding-top: 8px; }
  .profile { min-height: 40px; padding-block: 5px; }
  .company-switch { min-height: 42px; padding: 6px 9px; }
  .sidebar-head { min-height: 32px; }
}
/* ---------- L'animal fétiche en couleur ---------- */
.animal-svg { display: block; width: 100%; height: 100%; }
.nav-icon .animal-svg { width: 19px; height: 19px; margin: -1px; }
.chat-home-mark { background: color-mix(in srgb, var(--brand-soft) 60%, var(--surface)); } .chat-home-mark .animal-svg { width: 28px; height: 28px; }
.animal-choix .animal-svg { width: 52px; height: 52px; }
.animal-actuel { background: color-mix(in srgb, var(--brand-soft) 60%, var(--surface)); } .animal-actuel .animal-svg { width: 34px; height: 34px; }
.work-animal { width: 22px; height: 22px; } .work-animal .animal-svg { width: 22px; height: 22px; }
.mot-du-jour { display: flex; align-items: center; gap: 12px; max-width: 640px; margin: 2px 0 18px; }
.mot-mascotte { display: grid; width: 44px; height: 44px; flex: none; place-items: center; padding: 5px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); cursor: pointer; transition: transform .2s cubic-bezier(.32, .72, 0, 1); }
.mot-mascotte:hover { transform: rotate(-6deg) scale(1.06); } .mot-mascotte .icon { width: 20px; height: 20px; color: var(--brand); }
.mot-du-jour p { position: relative; margin: 0; padding: 9px 13px; border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; background: var(--surface); color: var(--ink-muted); font-size: 13.5px; line-height: 1.45; }
.mot-du-jour p b { color: var(--ink); font-weight: 600; }
.lien-bouton { padding: 0; border: 0; background: none; color: var(--brand); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .mot-mascotte { transition: none; } }

/* ---------- Mes notes : un tableau de liège et des post-its punaisés ---------- */
.liege { position: relative; padding: 22px 20px 26px; border: 10px solid #9a6a3f; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(60, 35, 15, .25), inset 0 2px 14px rgba(60, 35, 15, .28), 0 2px 0 #7d5330, 0 10px 24px rgba(60, 40, 20, .16);
  background-color: #c79e6e;
  background-image: radial-gradient(ellipse at 50% 40%, rgba(255, 240, 215, .16), transparent 70%), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .2 0 0 0 0 .08 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 100% 100%, 160px 160px; }
.liege-notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 22px 18px; }
.liege-petit .liege-notes { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.postit { position: relative; display: flex; flex-direction: column; min-height: 168px; padding: 20px 14px 12px; border: 0; border-radius: 2px 2px 3px 18px / 2px 2px 3px 8px; color: #3b3326; text-align: left;
  background: var(--postit, #fff1a1); box-shadow: 0 1px 1px rgba(0, 0, 0, .12), 0 8px 14px -6px rgba(60, 40, 15, .45); transform: rotate(var(--incl, 0deg)); transition: transform .18s cubic-bezier(.32, .72, 0, 1), box-shadow .18s; }
.postit::after { content: ""; position: absolute; right: 0; bottom: 0; width: 26px; height: 22px; background: linear-gradient(135deg, transparent 50%, rgba(0, 0, 0, .07) 50%); border-radius: 0 0 3px 0; }
.postit:hover, .postit:focus-within { transform: rotate(0deg) scale(1.03); z-index: 2; box-shadow: 0 2px 2px rgba(0, 0, 0, .12), 0 16px 24px -8px rgba(60, 40, 15, .5); }
.postit[data-domain] { --postit: var(--domain-bg); --punaise: var(--domain-ink); color: var(--domain-ink); }
.punaise { position: absolute; top: -7px; left: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; z-index: 1;
  background: radial-gradient(circle at 35% 32%, rgba(255, 255, 255, .85) 0 2px, transparent 3px), var(--punaise, #e0453a); box-shadow: 0 2px 0 rgba(0, 0, 0, .25), 2px 5px 5px rgba(40, 20, 0, .35); }
.postit-corps { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.postit-corps:focus-visible { outline: 2px dashed rgba(59, 51, 38, .6); outline-offset: 4px; }
.postit-cat { color: var(--domain-ink); opacity: .72; font: 600 10.5px/1.2 var(--font-sans); letter-spacing: .05em; text-transform: uppercase; }
.postit-titre { font: 700 21px/1.12 "Caveat", "Segoe Print", "Bradley Hand", cursive; color: var(--domain-ink, #2f2819); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.postit-trombone { display: inline-flex; align-items: center; gap: 5px; color: var(--domain-ink); opacity: .8; font-size: 12px; } .postit-trombone .icon { width: 13px; height: 13px; }
.postit-pied { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 10px; font-size: 12px; color: var(--domain-ink); }
.postit-tampon { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border: 1.5px solid currentColor; border-radius: 4px; font: 700 11px/1.5 var(--font-sans); text-transform: uppercase; letter-spacing: .03em; transform: rotate(-3deg); }
.postit-tampon.late { color: var(--late); } .postit-tampon.soon { color: var(--soon); } .postit-tampon.ready { color: var(--domain-ink); opacity: .8; } .postit-tampon.ok { color: var(--brand); } .postit-tampon .icon { width: 12px; height: 12px; }
.postit[data-state="faite"], .postit[data-state="ignoree"] { opacity: .72; } .postit[data-state="faite"] .postit-titre, .postit[data-state="ignoree"] .postit-titre { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: rgba(59, 51, 38, .45); }
.postit-vierge { align-items: center; justify-content: center; gap: 8px; --postit: rgba(255, 252, 240, .72); color: #6b5a3f; font: 700 20px/1.1 "Caveat", cursive; cursor: pointer; border: 2px dashed rgba(107, 90, 63, .35); box-shadow: none; } .postit-vierge .icon { width: 22px; height: 22px; }
.postit-vierge:hover { --postit: #fffdf4; }
@media (max-width: 767px) { .liege { padding: 18px 12px 20px; border-width: 7px; } .liege-notes, .liege-petit .liege-notes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; } .postit { min-height: 140px; } .postit-titre { font-size: 18px; } }
@media (prefers-reduced-motion: reduce) { .postit { transition: none; } }

/* Mobile : la carte de l'entreprise n'apparaît que dans le menu ouvert, pas dans la barre du bas. */
@media (max-width: 767px) { .sidebar:not(.mobile-open) .company-switch { display: none; } .sidebar:not(.mobile-open) .sidebar-nav { flex-direction: row; flex: 1 1 auto; } .sidebar:not(.mobile-open) .sidebar-nav > .nav-link { flex: 1 1 0; } }

/* ---------- Menu : catégories nommées en petit, conversations repliables ---------- */
@media (min-width: 768px) {
  .process-nav .nav-link { min-height: 27px; padding-block: 2px; font-size: 12.5px; }
  .process-nav .domain-tile { width: 20px; height: 20px; border-radius: 6px; } .process-nav .domain-tile .icon { width: 12px; height: 12px; }
}
@media (min-width: 768px) and (max-height: 760px) {
  .sidebar-nav .nav-link, .sidebar-bottom .nav-link { min-height: 27px; padding-block: 2px; font-size: 13px; }
  .process-nav .nav-link { min-height: 25px; font-size: 12px; }
  .nav-section-title { padding-top: 5px; }
}
.nav-replier { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: none; cursor: pointer; text-align: left; border-radius: 6px; }
.nav-replier:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 4%, transparent); }
.nav-replier .icon { width: 13px; height: 13px; margin-left: auto; transition: rotate .15s; } .nav-replier[aria-expanded="false"] .icon { rotate: -90deg; }
.nav-compte { padding: 0 6px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 7%, transparent); font-size: 10.5px; line-height: 16px; }
.nav-conversations[hidden] { display: none !important; }
@media (min-width: 1024px) { body.nav-reduite .nav-replier { display: none; } }

/* Le texte de la note en noir (le reste garde la couleur de la catégorie) ; en mode sombre, l'encre claire du thème. */
.postit-titre { color: var(--ink); }
/* La note ouverte : son texte se modifie comme sur le post-it */
.note-edition .note-titre { padding: 12px 14px; border-radius: 4px 4px 4px 14px; background: var(--domain-bg); border-color: color-mix(in srgb, var(--domain-ink) 25%, transparent); color: var(--ink); font: 700 23px/1.15 "Caveat", "Segoe Print", cursive; resize: vertical; }

/* ---------- Pastilles de catégorie : les couleurs du menu ---------- */
.pastilles { margin: 0; padding: 0; border: 0; min-width: 0; }
.pastilles legend, .planif legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.pastilles-liste { display: flex; flex-wrap: wrap; gap: 6px; }
.pastille { position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 4px 12px 4px 5px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); color: var(--ink-muted); font-size: 13px; font-weight: 500; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.pastille-icone { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: var(--domain-bg); color: var(--domain-ink); }
.pastille-icone .icon { width: 13px; height: 13px; }
.pastille:hover { border-color: color-mix(in srgb, var(--domain-ink) 35%, var(--line)); color: var(--ink); }
.pastille:has(input:checked) { border-color: var(--domain-ink); background: var(--domain-bg); color: var(--domain-ink); font-weight: 650; }
.pastille:has(input:checked) .pastille-icone { background: var(--domain-ink); color: var(--domain-bg); }
.pastille:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- Temporalité d'une routine ---------- */
.planif { display: grid; gap: 12px; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-muted); min-width: 0; }
.planif > legend { float: left; width: 100%; margin-bottom: 0; }
.planif-ligne { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; clear: both; }
.planif-repetition { flex: 1 1 240px; } .planif-repetition select { font-weight: 500; }
.planif-heure { display: grid; gap: 6px; flex: 0 0 140px; font-size: 13px; font-weight: 600; }
.planif-heure[hidden], .planif-fuseau[hidden] { display: none; }
#planif-detail { display: grid; gap: 8px; } #planif-detail:empty { display: none; }
.puces { display: flex; flex-wrap: wrap; gap: 6px; }
.puce { display: inline-grid; min-width: 38px; height: 38px; place-items: center; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); color: var(--ink-muted); font: 500 14px/1 var(--font-sans); cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .1s; }
.puce:hover { border-color: var(--ink-muted); color: var(--ink); }
.puce:active { transform: scale(.96); }
.puce[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--surface); }
.puces-mois { display: grid; grid-template-columns: repeat(7, minmax(0, 38px)); gap: 6px; }
.puces-mois .puce { min-width: 0; padding: 0; font-size: 13px; }
.puce-date { display: inline-flex; gap: 4px; height: 34px; padding: 0 4px 0 12px; color: var(--ink); cursor: default; }
.puce-retirer { display: grid; width: 24px; height: 24px; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--ink-muted); cursor: pointer; }
.puce-retirer:hover { background: var(--surface-muted); color: var(--late); } .puce-retirer .icon { width: 13px; height: 13px; }
.planif-dates { display: flex; gap: 8px; } .planif-dates .field { max-width: 200px; }
.planif-resume { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--ink); font-size: 13.5px; font-weight: 600; }
.planif-resume .icon { width: 16px; height: 16px; color: var(--brand); flex: none; }

/* ---------- Résultats d'une routine : chaque élément s'ouvre ---------- */
.resultats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.resultat { display: inline-flex; max-width: 100%; align-items: center; gap: 6px; min-height: 30px; padding: 4px 11px 4px 8px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); color: var(--ink); font: 500 12.5px/1.2 var(--font-sans); text-align: left; text-decoration: none; cursor: pointer; transition: border-color .15s, background .15s; }
.resultat span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34ch; }
.resultat .icon { width: 14px; height: 14px; flex: none; color: var(--domain-ink, var(--brand)); }
.resultat[data-domain=""] .icon, .resultat-conv .icon { color: var(--brand); }
.resultat:hover { border-color: var(--domain-ink, var(--brand)); background: var(--domain-bg, var(--brand-soft)); }
.resultat-conv { color: var(--brand); font-weight: 600; }
.agent-resultat { margin-top: 4px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--surface-muted); }
.agent-resultat p { margin: 4px 0 0; font-size: 13px; line-height: 1.45; }
.agent-resultat.vide { padding: 10px 14px; } .agent-resultat.echec { background: var(--late-soft); }
.agent-resultat-tete { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.activity-dot.echec { background: var(--late-soft); color: var(--late); }
.activity-corps { min-width: 0; }
.lien-titre { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.lien-titre:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.table td .resultats { margin-top: 6px; }

/* ---------- Agenda de Ma journée ---------- */
.segment { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); }
.segment button { min-height: 28px; padding: 0 14px; border: 0; border-radius: var(--radius-pill); background: none; color: var(--ink-muted); font: 600 12.5px/1 var(--font-sans); cursor: pointer; }
.segment button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.agenda .section-heading { align-items: center; }
.ag-carte { overflow: hidden; }
.ag-jour { display: grid; grid-template-columns: 132px minmax(0, 1fr); }
.ag-date { display: grid; align-content: center; justify-items: center; gap: 2px; padding: 18px 10px; border-right: 1px solid var(--line); background: var(--surface-muted); text-align: center; }
.ag-date span { color: var(--ink-muted); font-size: 13px; }
.ag-date b { font: 600 46px/1 var(--font-sans); letter-spacing: -.02em; color: var(--ink); }
.ag-liste { display: grid; gap: 2px; padding: 10px 12px; align-content: start; min-height: 150px; }
.ag-ev { position: relative; display: grid; grid-template-columns: 58px 26px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 42px; padding: 6px 10px; border: 0; border-radius: 10px; background: none; color: var(--ink); font: inherit; text-align: left; text-decoration: none; }
.ag-ev::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--domain-ink, var(--brand)); opacity: .7; }
a.ag-ev, button.ag-ev { cursor: pointer; } a.ag-ev:hover, button.ag-ev:hover { background: var(--domain-bg, var(--surface-muted)); }
.ag-heure { padding-left: 6px; color: var(--ink-muted); font: 600 12.5px/1 var(--font-sans); font-variant-numeric: tabular-nums; }
.ag-icone { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 7px; background: var(--domain-bg, var(--surface-muted)); color: var(--domain-ink, var(--ink-muted)); }
.ag-icone .icon { width: 13px; height: 13px; }
.ag-titre { overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.ag-info { overflow: hidden; max-width: 30ch; color: var(--ink-muted); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.ag-fait .ag-titre, .ag-fait .ag-heure { color: var(--ink-muted); } .ag-fait .ag-icone { background: var(--brand-soft); color: var(--brand); }
.ag-echec .ag-icone { background: var(--late-soft); color: var(--late); }
.ag-routine .ag-icone { border: 1.5px dashed var(--domain-ink, var(--brand)); background: none; }
.ag-maintenant { position: relative; display: flex; align-items: center; height: 18px; margin: 2px 0; }
.ag-maintenant::after { content: ""; flex: 1; height: 2px; margin-left: 6px; border-radius: 2px; background: var(--late); }
.ag-maintenant span { padding: 1px 7px; border-radius: var(--radius-pill); background: var(--late); color: var(--surface); font: 700 11px/16px var(--font-sans); font-variant-numeric: tabular-nums; }
.ag-vide { display: grid; gap: 4px; place-content: center; min-height: 130px; text-align: center; }
.ag-semaine { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.ag-col { display: grid; grid-template-rows: auto 1fr; min-width: 0; border-left: 1px solid var(--line); }
.ag-col:first-child { border-left: 0; } .ag-col.we { background: color-mix(in srgb, var(--surface-muted) 55%, var(--surface)); }
.ag-col-tete { display: grid; justify-items: center; gap: 4px; padding: 12px 4px 8px; }
.ag-col-tete span { color: var(--ink-muted); font: 600 11.5px/1 var(--font-sans); letter-spacing: .04em; text-transform: uppercase; }
.ag-col-tete b { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; font: 600 17px/1 var(--font-sans); }
.ag-col.auj .ag-col-tete b { background: var(--ink); color: var(--surface); }
.ag-col.auj .ag-col-tete span { color: var(--ink); }
.ag-col.passe .ag-col-tete b { color: var(--ink-muted); }
.ag-col-evs { display: grid; align-content: start; gap: 4px; min-height: 120px; padding: 4px 6px 12px; }
.ag-ev.compact { grid-template-columns: minmax(0, 1fr); gap: 1px; min-height: 0; padding: 5px 7px 5px 10px; border-radius: 7px; background: var(--domain-bg, var(--surface-muted)); color: var(--domain-ink, var(--ink)); }
.ag-ev.compact::before { top: 5px; bottom: 5px; left: 3px; width: 2.5px; }
.ag-ev.compact .ag-icone { display: none; }
.ag-ev.compact .ag-heure { padding: 0; color: inherit; font-size: 11px; opacity: .85; } .ag-ev.compact .ag-heure:empty { display: none; }
.ag-ev.compact .ag-titre { display: -webkit-box; color: var(--ink); font-size: 12px; line-height: 1.25; white-space: normal; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ag-ev.compact.ag-fait { opacity: .72; }
.ag-ev.compact.ag-routine { background: var(--surface); outline: 1.5px dashed color-mix(in srgb, var(--domain-ink) 55%, transparent); outline-offset: -1.5px; }
.ag-plus { padding-left: 8px; color: var(--ink-muted); font: 600 11.5px/1.4 var(--font-sans); }
.ag-pied { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--ink-muted); font-size: 12.5px; }
.ag-pied .icon { width: 14px; height: 14px; flex: none; } .ag-pied a { margin-left: auto; color: var(--brand); font-weight: 600; white-space: nowrap; }
@media (max-width: 767px) {
  .ag-jour { grid-template-columns: 1fr; } .ag-date { grid-auto-flow: column; gap: 8px; padding: 10px; border-right: 0; border-bottom: 1px solid var(--line); } .ag-date b { font-size: 22px; }
  .ag-ev { grid-template-columns: 46px 24px minmax(0, 1fr); } .ag-info { display: none; }
  .ag-semaine { grid-template-columns: 1fr; } .ag-col { grid-template-columns: 56px minmax(0, 1fr); grid-template-rows: none; border-top: 1px solid var(--line); border-left: 0; } .ag-col:first-child { border-top: 0; }
  .ag-col-evs { min-height: 0; padding: 8px 8px 8px 0; } .ag-col-tete { padding: 8px 4px; } .ag-rien { display: block; height: 18px; }
  .ag-pied { flex-wrap: wrap; } .ag-pied a { margin-left: 22px; }
  .puces-mois { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .puce, .pastille, .resultat { transition: none; } }

/* Les cartes de routine gardent leur contenu en haut, même étirées à la hauteur de leur voisine. */
.agent-card { align-content: start; }
.ag-nav { display: flex; align-items: center; gap: 2px; margin-right: auto; margin-left: 14px; }
.ag-nav .icon-button { width: 30px; height: 30px; } .ag-nav .icon-button:disabled, .ag-nav .button:disabled { opacity: .35; cursor: default; }
.ag-prec { rotate: 180deg; }
.ag-periode { margin-left: 8px; color: var(--ink-muted); font-size: 13px; font-weight: 600; }
@media (max-width: 767px) { .agenda .section-heading { flex-wrap: wrap; } .ag-nav { order: 3; width: 100%; margin: 4px 0 0; } }
@media (max-width: 767px) { .ag-col-tete { align-content: start; } }
.ag-pied > span { flex: 1 1 0; min-width: 0; }

/* ---------- Aller droit au but : cadres cliquables et mise en évidence de l'endroit à remplir ---------- */
.kpi-action { display: grid; align-content: start; gap: inherit; width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.kpi-action:hover { border-top-color: var(--brand); border-right-color: var(--brand); border-bottom-color: var(--brand); box-shadow: 0 4px 14px rgba(30, 107, 82, .12); transform: translateY(-1px); }
.kpi-action:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.kpi-aller { display: inline-flex; align-items: center; gap: 6px; justify-self: start; margin-top: 6px; padding: 5px 12px; border-radius: var(--radius-pill); background: var(--ink); color: var(--surface); font: 600 12.5px/1.2 var(--font-sans); }
.kpi-aller .icon { width: 14px; height: 14px; }
.bib-aller { display: inline-flex; gap: 6px; margin-top: 6px; } .bib-aller .icon { width: 13px; height: 13px; }
.cible-ici { animation: cible-ici 2.4s cubic-bezier(.32, .72, 0, 1); border-radius: var(--radius-md); }
@keyframes cible-ici { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 12%, 70% { box-shadow: 0 0 0 4px var(--surface), 0 0 0 7px var(--brand); background-color: color-mix(in srgb, var(--brand-soft) 55%, transparent); } }
label[data-choisir]:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .kpi-action { transition: none; } .kpi-action:hover { transform: none; } .cible-ici { animation: none; outline: 3px solid var(--brand); outline-offset: 3px; } }
[data-domain="autre"] { --domain-bg: var(--autre); --domain-ink: var(--autre-ink); }

/* Toast avec action (« Annuler ») */
.toast { display: flex; align-items: center; gap: 14px; }
.toast-action { flex: none; margin-left: auto; padding: 4px 10px; border: 1px solid currentColor; border-radius: var(--radius-pill); background: none; color: inherit; font: 600 13px/1.2 var(--font-sans); cursor: pointer; }
.toast-action:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.mot-du-jour p a { color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Cadre légal : une question par ligne, réponses en un clic ---------- */
.cadre-liste { display: grid; gap: 4px; }
.cadre-q { display: grid; gap: 8px; margin: 0; padding: 12px 0; border: 0; border-top: 1px solid var(--line); min-width: 0; }
.cadre-liste > .cadre-q:first-child { border-top: 0; padding-top: 4px; }
.cadre-q legend { display: grid; gap: 2px; float: left; width: 100%; padding: 0; margin-bottom: 8px; }
.cadre-q legend b { font-size: 14px; font-weight: 600; }
.cadre-q .choice-list { clear: both; }
.cadre-q.deduit .choice-list label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.cadre-deduit { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); font-size: 12.5px; }
.cadre-deduit .icon { width: 13px; height: 13px; flex: none; }
.conv-lignes { display: grid; gap: 6px; clear: both; }
.conv-ligne { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; align-items: center; }
.conv-lib { grid-column: 2; margin-top: -2px; }

/* Rappel de minimisation sous le champ de l'assistant */
.composer-rappel { display: inline-flex; align-items: center; gap: 5px; margin-right: auto; padding-left: 6px; color: var(--ink-muted); font-size: 11.5px; line-height: 1.3; }
.composer-rappel .icon { width: 12px; height: 12px; flex: none; }
@media (max-width: 640px) { .composer-rappel { display: none; } }

/* ---------- Les engagements de l'entrée ---------- */
.consent-voile { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(20, 18, 14, .42); overflow-y: auto; }
.consent { display: grid; gap: 12px; width: min(560px, 100%); padding: 26px 26px 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 24px 60px rgba(20, 18, 14, .25); }
.consent h2 { margin: 0; font: var(--text-section); font-size: 24px; }
.consent-mascotte { display: grid; width: 52px; height: 52px; place-items: center; padding: 6px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-muted); }
.consent-mascotte .icon { width: 24px; height: 24px; color: var(--brand); }
.consent-liste { display: grid; gap: 8px; }
.consent .rule-check { font-size: 14px; line-height: 1.45; cursor: pointer; }
.consent .rule-check:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand-soft) 45%, var(--surface)); }
.consent button[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- Fiabilité d'une réponse ---------- */
.fiab { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; padding: 5px 11px; border-radius: var(--radius-pill); font-size: 12.5px; font-weight: 600; background: var(--surface-muted); color: var(--ink-muted); }
.fiab .icon { width: 13px; height: 13px; flex: none; }
.fiab[data-ton="ok"] { background: var(--brand-soft); color: var(--brand); }
.fiab[data-ton="moyen"] { background: var(--soon-soft); color: var(--soon); }
.fiab[data-ton="alerte"] { background: var(--late-soft); color: var(--late); }
.msg-actions { display: flex; align-items: center; gap: 6px; }
.msg-actions .button .icon { width: 14px; height: 14px; }

/* ---------- Bandeau d'information d'une catégorie (ex. pas de CSE sous 11 salariés) ---------- */
.bandeau-info { display: flex; gap: 10px; align-items: center; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-muted); font-size: 14px; }
.bandeau-info .icon { flex: none; width: 18px; height: 18px; color: var(--brand); }

/* ---------- Règles : tableau ou cartes ---------- */
.regles-barre { display: grid; gap: 12px; margin-bottom: 14px; }
.regles-outils { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.regles-recherche { display: flex; flex: 1 1 260px; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); }
.regles-recherche:focus-within { border-color: var(--ink); }
.regles-recherche .icon { width: 16px; height: 16px; color: var(--ink-muted); flex: none; }
.regles-recherche input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); font: inherit; }
.segment button .icon { width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; }
.regles-filtres { display: flex; flex-wrap: wrap; gap: 6px; }
.filtre-cat { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); color: var(--ink-muted); font: 600 13px/1 var(--font-sans); cursor: pointer; }
.filtre-cat .point { width: 9px; height: 9px; border-radius: 50%; background: var(--domain-ink, var(--ink-muted)); }
.filtre-cat .compte { color: var(--ink-muted); font-weight: 500; }
.filtre-cat:hover { border-color: var(--ink-muted); }
.filtre-cat[aria-pressed="true"] { border-color: var(--domain-ink, var(--ink)); background: var(--domain-bg, var(--ink)); color: var(--domain-ink, var(--surface)); }
.filtre-cat[aria-pressed="true"] .compte { color: inherit; opacity: .75; }
.regles-avalider { display: flex; align-items: center; gap: 6px; margin: 0; }
.regles-avalider .icon { width: 15px; height: 15px; color: var(--brand); }
.regles-tableau { background: var(--surface); }
.regles-tableau .table th { padding: 12px 14px; background: var(--surface-muted); }
.regles-tableau .table td { padding: 12px 14px; vertical-align: middle; }
.regles-tableau tbody tr:last-child td { border-bottom: 0; }
.regle-ligne { cursor: pointer; transition: background .12s; }
.regle-ligne:hover, .regle-ligne:focus-visible { background: var(--surface-muted); outline: none; }
.regle-ligne:focus-visible { box-shadow: inset 3px 0 0 var(--brand); }
.col-regle { width: 60%; }
.col-regle b { display: block; color: var(--ink); font-weight: 600; }
.col-regle span { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink-muted); font-size: 13.5px; }
.col-origine { white-space: nowrap; }
.col-ouvrir { width: 28px; color: var(--ink-muted); }
.col-ouvrir .icon { width: 16px; height: 16px; }
.regles-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; align-content: start; }
.regle-carte { display: grid; gap: 8px; align-content: start; padding: 16px 18px; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.regle-carte:hover, .regle-carte:focus-visible { border-color: var(--ink-muted); box-shadow: var(--shadow-card); outline: none; }
.regle-carte .task-title { margin: 0; }
.regle-corps { margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink-muted); font-size: 14px; }
.regle-pied { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.regle-texte { margin: 0; font-size: 15.5px; line-height: 1.6; white-space: pre-wrap; }
@media (max-width: 720px) { .col-origine { display: none; } .col-regle { width: auto; } }

/* ---------- Espace salarié : trois façons de l'ouvrir, aperçu plein écran ---------- */
.usages-salarie { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.usage-carte { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.usage-carte h3 { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; font-size: 16px; }
.usage-carte h3 .icon { width: 18px; height: 18px; color: var(--brand); }
.usage-carte p { margin: 0; color: var(--ink-muted); font-size: 14px; }
.usage-carte .card-actions { margin-top: auto; }
.maq { position: relative; height: 112px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-muted); }
.maq-ligne { display: block; height: 8px; border-radius: 4px; background: var(--line); }
.maq-bulle { padding: 16px; display: grid; gap: 9px; align-content: start; }
.maq-bulle .l1 { width: 55%; height: 10px; } .maq-bulle .l2 { width: 85%; } .maq-bulle .l3 { width: 70%; }
.maq-rond { position: absolute; right: 14px; bottom: 14px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: var(--surface); box-shadow: 0 6px 16px rgba(20, 18, 14, .2); }
.maq-rond .icon { width: 20px; height: 20px; }
.maq-copilote { display: grid; gap: 8px; align-content: center; padding: 12px; font-size: 11.5px; line-height: 1.35; }
.maq-q { justify-self: end; max-width: 80%; padding: 6px 10px; border-radius: 12px 12px 2px 12px; background: var(--ink); color: var(--surface); }
.maq-r { justify-self: start; max-width: 88%; padding: 6px 10px; border: 1px solid var(--line); border-radius: 12px 12px 12px 2px; background: var(--surface); color: var(--ink); }
.maq-r b { display: block; color: var(--brand); font-size: 11px; }
.maq-mail { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px; }
.maq-enveloppe { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--brand); }
.maq-enveloppe .icon { width: 22px; height: 22px; }
.maq-brouillon { display: grid; gap: 7px; width: 55%; padding: 10px 12px; border: 1px dashed var(--brand); border-radius: 10px; background: var(--surface); font-size: 11px; }
.maq-brouillon b { color: var(--brand); }
.maq-brouillon .court { width: 60%; }
.apercu-barre { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); font-size: 14px; color: var(--ink-muted); }
.apercu-barre > span { display: inline-flex; align-items: center; gap: 8px; }
.apercu-barre .icon { width: 16px; height: 16px; }
.icon.retour { transform: rotate(180deg); }
