/* AfroElite Writer — interface de la plateforme (noir et doré, mode clair et nuit). */

.aew-root {
	--bg: #F7F6F3; --surface: #FFFFFF; --surface-2: #FAF8F4; --ink: #111111; --text-2: #3A372F; --muted: #6B665D;
	--line: #ECEAE5; --line-strong: #D2CFC7; --line-soft: #F0EEE9; --hover: #FBFAF7; --chip: #EEECE6;
	--gold: #E09900; --gold-wash: #FFF4DC; --gold-line: #F1D48A; --gold-ink: #5C3D00; --gold-text: #8A5D00;
	--red: #B42318; --red-wash: #FDECEA; --red-line: #E8B4AE; --green: #1F7A4D; --green-wash: #E5F3EB;
	--blue: #1E4E8C; --blue-wash: #E0ECFB; --violet: #4B2A7A; --violet-wash: #EEE6F8;
	--black: #0B0B0B; --radius: 12px;
	color-scheme: light;
	min-height: 100vh; background: var(--bg); color: var(--ink); position: relative; overflow-x: clip;
	font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 15px; line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}
.aew-root[data-theme="dark"] {
	--bg: #121212; --surface: #1A1A1A; --surface-2: #161616; --ink: #F2F0EB; --text-2: #D6D1C7; --muted: #A39D92;
	--line: #2A2A2A; --line-strong: #3D3D3D; --line-soft: #232323; --hover: #202020; --chip: #262626;
	--gold-wash: #2A2111; --gold-line: #5A4413; --gold-ink: #F2C25B; --gold-text: #E8A825;
	--red: #FF8A80; --red-wash: #3A1715; --red-line: #6B2A25; --green: #6FD3A0; --green-wash: #13291E;
	--blue: #9CC2FF; --blue-wash: #15243A; --violet: #CDB6F2; --violet-wash: #251C36;
	color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
	.aew-root[data-theme="auto"] {
		--bg: #121212; --surface: #1A1A1A; --surface-2: #161616; --ink: #F2F0EB; --text-2: #D6D1C7; --muted: #A39D92;
		--line: #2A2A2A; --line-strong: #3D3D3D; --line-soft: #232323; --hover: #202020; --chip: #262626;
		--gold-wash: #2A2111; --gold-line: #5A4413; --gold-ink: #F2C25B; --gold-text: #E8A825;
		--red: #FF8A80; --red-wash: #3A1715; --red-line: #6B2A25; --green: #6FD3A0; --green-wash: #13291E;
		--blue: #9CC2FF; --blue-wash: #15243A; --violet: #CDB6F2; --violet-wash: #251C36;
		color-scheme: dark;
	}
}
.aew-root *, .aew-root *::before, .aew-root *::after { box-sizing: border-box; }
.aew-root a { color: var(--gold-text); }
.aew-root a:hover { color: var(--gold-ink); }
.aew-root h1, .aew-root h2, .aew-root h3 { margin: 0; color: inherit; font-family: inherit; letter-spacing: -0.02em; }
.aew-root h1 { font-size: 28px; line-height: 1.2; font-weight: 700; }
.aew-root h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.aew-root h3 { font-size: 16px; font-weight: 700; letter-spacing: 0; }
.aew-root p { margin: 0; }
.aew-root img { max-width: 100%; }
.aew-root button, .aew-root input, .aew-root select, .aew-root textarea { font-family: inherit; font-size: inherit; }
.aew-root :focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.aew-sr { position: absolute !important; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.aew-muted { color: var(--muted); }
.aew-small { font-size: 13px; }
.aew-icon { flex: 0 0 auto; }

/* ---------- Structure de l'application ---------- */
.aew-app { display: flex; flex-wrap: wrap; align-items: stretch; min-height: 100vh; }
.aew-side {
	flex: 1 1 240px; min-width: 0; max-width: 300px; padding: 28px 18px; background: var(--black); color: #F2F0EB;
	display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.aew-brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; text-decoration: none; }
.aew-brand-icon { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 12px; background: #fff; display: flex; align-items: center; justify-content: center; }
.aew-brand-icon img { width: 40px; height: 40px; object-fit: contain; }
.aew-brand-name { font-weight: 700; font-size: 16px; color: #fff; white-space: nowrap; line-height: 1.25; }
.aew-brand-name span { color: var(--gold); }
.aew-brand-sub { display: block; font-size: 12px; font-weight: 400; color: #A39D92; }
.aew-nav { display: flex; flex-direction: column; gap: 4px; }
.aew-nav a {
	min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px;
	border-radius: 10px; color: #CFCAC0; text-decoration: none; font-weight: 500; transition: background-color .15s ease, color .15s ease;
}
.aew-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.aew-nav a.is-active { background: rgba(255,255,255,.08); color: var(--gold); font-weight: 600; }
.aew-badge-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--gold); color: #111; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.aew-side-card { margin-top: auto; padding: 16px; border-radius: 12px; background: #161616; border: 1px solid #262626; display: flex; flex-direction: column; gap: 4px; }
.aew-side-card .aew-side-label { font-size: 13px; color: #A39D92; }
.aew-side-card .aew-side-value { font-weight: 700; font-size: 20px; color: var(--gold); letter-spacing: 0.02em; }
.aew-side-user { display: flex; align-items: center; gap: 12px; }
.aew-side-user .aew-u-name { font-weight: 600; font-size: 14px; color: #fff; }
.aew-side-user .aew-u-role { font-size: 12px; color: var(--gold); }
.aew-side-logout { color: #A39D92 !important; font-size: 13px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.aew-side-logout:hover { color: #fff !important; }

.aew-main { flex: 999 1 560px; min-width: 0; padding: 32px 40px 56px; display: flex; flex-direction: column; gap: 24px; }
.aew-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.aew-head-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.aew-crumb { font-size: 14px; color: var(--muted); }
.aew-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

@media (max-width: 860px) {
	.aew-side { position: static; height: auto; max-width: none; flex-basis: 100%; padding: 16px; gap: 14px; }
	.aew-nav { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
	.aew-nav a { white-space: nowrap; min-height: 40px; }
	.aew-side-card { display: none; }
	.aew-main { padding: 22px 16px 40px; }
}

/* ---------- Boutons ---------- */
.aew-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 8px;
	border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink) !important; font-weight: 600; font-size: 15px;
	cursor: pointer; text-decoration: none; transition: filter .15s ease, box-shadow .15s ease, background-color .15s ease; white-space: nowrap;
}
.aew-btn:hover { background: var(--hover); }
.aew-btn--gold { background: var(--gold); border-color: var(--gold); color: #111 !important; }
.aew-btn--gold:hover { background: var(--gold); filter: brightness(.94); box-shadow: 0 4px 14px rgba(224,153,0,.28); }
.aew-btn--dark { background: var(--black); border-color: var(--black); color: #fff !important; }
.aew-btn--dark:hover { background: #222; }
.aew-btn--danger { color: var(--red) !important; border-color: var(--red-line); }
.aew-btn--danger-solid { background: #B42318; border-color: #B42318; color: #fff !important; }
.aew-btn--sm { min-height: 38px; padding: 0 12px; font-size: 14px; }
.aew-btn--block { width: 100%; }
.aew-btn--link { border: none; background: none; padding: 0; min-height: 44px; white-space: normal; text-align: left; justify-content: flex-start; color: var(--gold-text) !important; text-decoration: underline; text-underline-offset: 4px; }
.aew-btn[disabled], .aew-btn.is-disabled { opacity: .45; cursor: not-allowed; box-shadow: none; filter: none; }

/* ---------- Cartes et grilles ---------- */
.aew-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.aew-card--flush { padding: 0; gap: 0; overflow: hidden; }
.aew-card--dark { background: var(--black); border-color: var(--black); color: #fff; }
.aew-card--dark .aew-muted { color: #A39D92; }
.aew-card--gold { background: var(--gold-wash); border-color: var(--gold-line); color: var(--gold-ink); }
.aew-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.aew-card--flush > .aew-card-head { padding: 18px 22px; border-bottom: 1px solid var(--line); }
.aew-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.aew-col-main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.aew-col-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.aew-stack { display: flex; flex-direction: column; gap: 14px; }
.aew-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.aew-between { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.aew-divider { height: 1px; background: var(--line); border: 0; margin: 0; }

.aew-kpis { display: flex; flex-wrap: wrap; gap: 14px; }
.aew-kpi { flex: 1 1 190px; padding: 18px 20px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink) !important; }
.aew-kpi-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.aew-kpi-value { font-weight: 700; font-size: 30px; letter-spacing: -0.02em; line-height: 1.15; white-space: nowrap; }
.aew-kpi-sub { font-size: 13px; color: var(--muted); }
.aew-kpi--dark { background: var(--black); border-color: #2E2510; }
.aew-kpi--dark .aew-kpi-label, .aew-kpi--dark .aew-kpi-sub { color: #A39D92; }
.aew-kpi--dark .aew-kpi-value { color: var(--gold); font-size: 24px; }
.aew-kpi--hot { border-color: var(--gold-line); }

.aew-actions-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.aew-action {
	flex: 1 1 190px; padding: 20px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 10px;
	color: var(--ink) !important; text-decoration: none; box-shadow: 0 1px 2px rgba(17,17,17,.04); transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.aew-action:hover { border-color: #E8C46E; box-shadow: 0 10px 28px rgba(0,0,0,.08); transform: translateY(-2px); }
.aew-action-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--gold-wash); color: var(--gold-text); display: flex; align-items: center; justify-content: center; }
.aew-action-icon--red { background: var(--red-wash); color: var(--red); }
.aew-action strong { font-size: 16px; }
.aew-action span { font-size: 13px; color: var(--muted); }

/* ---------- Tableaux ---------- */
.aew-table-wrap { position: relative; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.aew-card--flush .aew-table-wrap { border: 0; border-radius: 0; }
.aew-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; }
.aew-table th { text-align: left; padding: 13px 18px; font-weight: 600; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.aew-table td { padding: 13px 18px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.aew-table tr:last-child td { border-bottom: 0; }
.aew-table tbody tr { transition: background-color .15s ease; }
.aew-table tbody tr:hover td { background: var(--hover); }
.aew-table .aew-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.aew-table .aew-strong { font-weight: 600; }
.aew-cell-sub { display: block; font-size: 13px; color: var(--muted); }

.aew-list-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 22px; border-top: 1px solid var(--line-soft); color: var(--ink); text-decoration: none; }
.aew-list-row:first-child { border-top: 0; }
a.aew-list-row:hover { background: var(--hover); }
.aew-list-row.is-current { background: var(--gold-wash); box-shadow: inset 3px 0 0 var(--gold); }

/* ---------- Pastilles de statut ---------- */
.aew-chip { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--chip); color: var(--text-2); }
.aew-chip--red { background: var(--red-wash); color: var(--red); }
.aew-chip--gold { background: var(--gold-wash); color: var(--gold-ink); }
.aew-chip--blue { background: var(--blue-wash); color: var(--blue); }
.aew-chip--violet { background: var(--violet-wash); color: var(--violet); }
.aew-chip--green { background: var(--green-wash); color: var(--green); }
.aew-dot { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; background: var(--gold); }
.aew-dot--red { background: #D9442F; } .aew-dot--blue { background: #2F6FD6; } .aew-dot--green { background: #1F8A55; }

/* ---------- Formulaires ---------- */
.aew-form { display: flex; flex-direction: column; gap: 18px; }
.aew-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1 1 220px; }
.aew-stack > .aew-field, .aew-card > .aew-field, .aew-wpanel > .aew-field, form > .aew-field { flex: 0 0 auto; }
.aew-field > label, .aew-legend { font-weight: 600; }
.aew-field .aew-hint { font-size: 13px; color: var(--muted); font-weight: 400; }
.aew-input, .aew-root select.aew-input, .aew-root textarea.aew-input {
	width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink);
	font-size: 15px; transition: border-color .15s ease, box-shadow .15s ease;
}
.aew-root textarea.aew-input { min-height: 110px; resize: vertical; line-height: 1.6; }
.aew-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(224,153,0,.2); }
.aew-input::placeholder { color: var(--muted); opacity: .85; }
.aew-file { padding: 10px; min-height: 46px; border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 14px; width: 100%; }
.aew-fields { display: flex; flex-wrap: wrap; gap: 16px; }
.aew-fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.aew-fieldset legend { padding: 0; margin-bottom: 10px; font-weight: 600; }
.aew-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.aew-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--gold); }

/* Choix en pastilles (radio et cases à cocher stylées). */
.aew-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.aew-pill { position: relative; }
.aew-pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.aew-pill span {
	display: inline-flex; align-items: center; min-height: 42px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line-strong);
	background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 500; transition: all .15s ease;
}
.aew-pill input:checked + span { border-color: var(--gold); background: var(--gold); color: #111; font-weight: 600; }
.aew-pill input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.aew-pill:hover span { border-color: #E8C46E; }

/* Notation par étoiles. */
.aew-stars { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.aew-stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.aew-stars label { cursor: pointer; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.aew-stars label svg path { fill: transparent; stroke: var(--gold); stroke-width: 1.4; transition: fill .1s ease; }
.aew-stars input:checked ~ label svg path, .aew-stars label:hover svg path, .aew-stars label:hover ~ label svg path { fill: var(--gold); }
.aew-stars-static { color: var(--gold); letter-spacing: 2px; }

/* ---------- Messages ---------- */
.aew-flash { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 10px; background: var(--gold-wash); color: var(--gold-ink); border: 1px solid var(--gold-line); font-weight: 600; }
.aew-flash--error { background: var(--red-wash); color: var(--red); border-color: var(--red-line); }
.aew-flash--info { background: var(--blue-wash); color: var(--blue); border-color: transparent; }
.aew-flash button { border: 0; background: transparent; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; min-width: 32px; min-height: 32px; }
.aew-note { padding: 14px 16px; border-radius: 10px; background: var(--blue-wash); color: var(--blue); font-size: 14px; }
.aew-empty { padding: 36px 24px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.aew-empty strong { color: var(--ink); font-size: 16px; }

/* ---------- Fil de commande ---------- */
.aew-thread { padding: 24px; display: flex; flex-direction: column; gap: 14px; background: var(--surface-2); max-height: 640px; overflow-y: auto; }
.aew-ev-sys { align-self: center; max-width: 600px; padding: 8px 14px; border-radius: 999px; background: var(--chip); color: var(--text-2); font-size: 13px; text-align: center; }
.aew-ev-msg { max-width: 560px; display: flex; flex-direction: column; gap: 4px; }
.aew-ev-msg.is-mine { align-self: flex-end; align-items: flex-end; }
.aew-ev-author { font-size: 12px; font-weight: 600; color: var(--muted); }
.aew-ev-bubble { padding: 12px 16px; border-radius: 4px 16px 16px 16px; background: var(--surface); border: 1px solid var(--line); white-space: pre-line; overflow-wrap: anywhere; }
.aew-ev-msg.is-mine .aew-ev-bubble { border-radius: 16px 4px 16px 16px; background: var(--gold-wash); border-color: var(--gold-line); color: var(--ink); }
.aew-ev-msg.is-question .aew-ev-bubble { border-color: #2F6FD6; }
.aew-ev-msg.is-staff .aew-ev-bubble { background: var(--blue-wash); border-color: transparent; }
.aew-ev-file { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--gold-line); max-width: 560px; }
.aew-ev-file.is-mine { align-self: flex-end; }
.aew-ev-file-ico { width: 38px; height: 46px; flex: 0 0 38px; border-radius: 4px; background: var(--gold-wash); color: var(--gold-text); font-size: 10px; font-weight: 800; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; }
.aew-ev-file-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.aew-ev-file-meta strong { overflow-wrap: anywhere; font-size: 14px; }
.aew-ev-time { font-size: 11px; color: var(--muted); }
.aew-composer { padding: 14px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.aew-composer-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.aew-composer textarea.aew-input { min-height: 48px; height: 48px; flex: 1 1 260px; }

/* ---------- Étapes ---------- */
.aew-steps { list-style: none; margin: 0; padding: 0; }
.aew-steps li { display: flex; gap: 12px; min-height: 40px; }
.aew-step-rail { display: flex; flex-direction: column; align-items: center; flex: 0 0 26px; }
.aew-step-dot { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--line-soft); color: var(--muted); }
.aew-step-line { width: 2px; flex: 1; min-height: 12px; margin: 3px 0; background: var(--line); }
.aew-steps li:last-child .aew-step-line { display: none; }
.aew-steps li.is-done .aew-step-dot { background: var(--gold); color: #111; }
.aew-steps li.is-done .aew-step-line { background: var(--gold); }
.aew-steps li.is-now .aew-step-dot { background: var(--surface); border: 2px solid var(--gold); color: var(--gold-text); }
.aew-steps li.is-now .aew-step-label { font-weight: 700; }
.aew-step-label { padding-top: 3px; font-size: 14px; color: var(--text-2); }
.aew-steps li.is-todo .aew-step-label { color: var(--muted); }

.aew-progress { height: 8px; border-radius: 4px; background: var(--line-soft); overflow: hidden; }
.aew-progress > span { display: block; height: 100%; background: var(--gold); border-radius: 4px; }

/* ---------- Avatars et stickers ---------- */
.aew-avatar { border-radius: 50%; background: var(--gold); color: #111; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; object-fit: cover; flex: 0 0 auto; }
.aew-sticker-row { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.aew-sticker-item { width: 96px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 12px; font-weight: 600; line-height: 1.3; transition: transform .2s ease; }
.aew-sticker-item:hover { transform: translateY(-4px); }
.aew-sticker-item.is-off { color: var(--muted); }

/* ---------- Bascule de thème ---------- */
.aew-theme-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-weight: 500; font-size: 14px; }
.aew-theme-btn .aew-ico-sun { display: none; color: var(--gold); }
.aew-root[data-theme="dark"] .aew-theme-btn .aew-ico-sun { display: inline; }
.aew-root[data-theme="dark"] .aew-theme-btn .aew-ico-moon { display: none; }

.aew-segment { display: inline-flex; gap: 2px; padding: 3px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.aew-segment button { min-height: 36px; min-width: 44px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font-weight: 600; font-size: 13px; cursor: pointer; }
.aew-segment button.is-on { background: var(--gold); color: #111; }

/* Interrupteur. */
.aew-switch { position: relative; display: inline-flex; width: 46px; height: 28px; flex: 0 0 46px; }
.aew-switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.aew-switch span { position: absolute; inset: 0; border-radius: 14px; background: var(--line-strong); transition: background-color .2s ease; }
.aew-switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s ease; }
.aew-switch input:checked + span { background: var(--gold); }
.aew-switch input:checked + span::after { transform: translateX(18px); }

/* Volets dépliables. */
.aew-details { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.aew-details > summary { cursor: pointer; padding: 14px 18px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.aew-details > summary::-webkit-details-marker { display: none; }
.aew-details > summary::after { content: '+'; font-size: 20px; color: var(--muted); }
.aew-details[open] > summary::after { content: '–'; }
.aew-details > .aew-details-body { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 12px; }

/* ---------- Pages d'authentification ---------- */
.aew-auth { display: flex; flex-wrap: wrap; min-height: 100vh; }
.aew-auth-side { flex: 1 1 340px; min-width: 0; max-width: 520px; padding: 40px 40px 32px; background: var(--black); color: #F2F0EB; display: flex; flex-direction: column; gap: 32px; }
.aew-auth-side h1 { font-size: 34px; line-height: 1.15; font-weight: 800; color: #fff; }
.aew-auth-side h1 span { color: var(--gold); }
.aew-auth-side p { color: #CFCAC0; }
.aew-auth-main { flex: 999 1 480px; min-width: 0; padding: 48px 48px 56px; display: flex; flex-direction: column; gap: 24px; max-width: 860px; }
.aew-auth-main .aew-kicker { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-text); }
.aew-auth-main h2 { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.aew-sep { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.aew-sep::before, .aew-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
@media (max-width: 760px) {
	.aew-auth-side { max-width: none; padding: 24px 16px; gap: 18px; }
	.aew-auth-side .aew-auth-extra { display: none; }
	.aew-auth-main { padding: 28px 16px 40px; flex-basis: 100%; }
	.aew-auth-side { flex-basis: 100%; }
}

/* Inscription Writer en étapes. */
.aew-wsteps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.aew-wsteps li { display: flex; gap: 14px; }
.aew-wsteps .aew-step-dot { width: 28px; height: 28px; background: transparent; border: 1.5px solid #3A3730; color: #8C857A; }
.aew-wsteps .aew-step-line { background: #2A2A2A; min-height: 20px; }
.aew-wsteps li.is-now .aew-step-dot { border: 2px solid var(--gold); color: var(--gold); background: transparent; }
.aew-wsteps li.is-done .aew-step-dot { border-color: var(--gold); background: var(--gold); color: #111; }
.aew-wsteps li.is-done .aew-step-line { background: var(--gold); }
.aew-wsteps .aew-wstep-text { display: flex; flex-direction: column; padding-bottom: 16px; }
.aew-wsteps .aew-wstep-text strong { color: #8C857A; font-weight: 600; }
.aew-wsteps li.is-now .aew-wstep-text strong { color: #fff; font-weight: 700; }
.aew-wsteps li.is-done .aew-wstep-text strong { color: #CFCAC0; }
.aew-wsteps .aew-wstep-text span { font-size: 13px; color: #8C857A; }
.aew-wpanel[hidden] { display: none !important; }
[hidden] { display: none !important; }
.aew-choice { flex: 1 1 260px; min-width: 0; min-height: 180px; text-align: left; padding: 22px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 10px; cursor: pointer; position: relative; color: var(--ink); }
.aew-choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.aew-choice:has(input:checked) { border: 2px solid var(--gold); background: var(--gold-wash); }
.aew-choice strong { font-size: 17px; }
.aew-choice span.aew-choice-text { font-size: 14px; color: var(--text-2); }
.aew-cert-ok { display: flex; gap: 16px; align-items: center; padding: 16px; border-radius: 12px; background: var(--green-wash); color: var(--green); }
.aew-cert-ko { padding: 14px 16px; border-radius: 12px; background: var(--red-wash); color: var(--red); font-weight: 600; }
.aew-wordcount { font-weight: 700; }
.aew-wordcount.is-ok { color: var(--green); }
.aew-wordcount.is-ko { color: var(--gold-text); }
.aew-wnav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 20px; border-top: 1px solid var(--line); }

/* ---------- Pages publiques ---------- */
.aew-pub-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.aew-pub-head-in { max-width: 1200px; margin: 0 auto; padding: 0 32px; min-height: 76px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.aew-pub-head-in nav { display: flex; gap: 4px; flex-grow: 1; flex-wrap: wrap; }
.aew-pub-head-in nav a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 12px; color: var(--text-2); text-decoration: none; font-weight: 500; }
.aew-pub-wrap { max-width: 1200px; margin: 0 auto; padding: 40px 32px 72px; display: flex; flex-direction: column; gap: 24px; }
.aew-cover { background: var(--black); height: 200px; position: relative; overflow: hidden; }
.aew-cover img { position: absolute; right: 6%; top: -40px; width: 300px; height: 300px; object-fit: contain; opacity: .12; }
.aew-profile-card { margin-top: -110px; position: relative; box-shadow: 0 12px 32px rgba(0,0,0,.06); border-radius: 18px; padding: 28px 32px; }
.aew-profile-card .aew-avatar { margin-top: -76px; border: 6px solid var(--surface); box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.aew-verified { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 999px; background: var(--green-wash); color: var(--green); font-size: 13px; font-weight: 700; }
.aew-statbar { display: flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.aew-statbar > div { flex: 1 1 160px; padding: 18px 22px; display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--line); }
.aew-statbar > div:first-child { border-left: 0; }
.aew-statbar strong { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; }
.aew-tag { padding: 6px 12px; border-radius: 8px; background: var(--gold-wash); color: var(--gold-ink); font-size: 14px; font-weight: 600; }
.aew-tag--grey { background: var(--chip); color: var(--text-2); font-weight: 500; }
@media (max-width: 760px) {
	.aew-pub-head-in, .aew-pub-wrap { padding-left: 16px; padding-right: 16px; }
	.aew-profile-card { padding: 22px 18px; }
}

/* ---------- Impression (factures, historique) ---------- */
.aew-print { max-width: 820px; margin: 0 auto; padding: 40px 32px; background: #fff; color: #111; }
.aew-print table { width: 100%; border-collapse: collapse; font-size: 14px; }
.aew-print th, .aew-print td { padding: 10px 8px; border-bottom: 1px solid #ECEAE5; text-align: left; }
@media print {
	.aew-noprint { display: none !important; }
	.aew-print { padding: 0; }
	body { background: #fff !important; }
}
