/* Plateforme FATCA — habillage v2.
   Langage visuel : canevas clair, cartes arrondies sans bordure, tuiles noire et teintée, pastilles glissantes.
   Couleurs adaptées à l'identité Attijariwafa bank (jaune / rouge / noir) — approximations, à aligner sur la charte officielle. */
:root {
  --canvas: #efeeea; --surface: #fff; --soft: #f6f5f1; --ink: #141413; --ink-2: #45433e; --muted: #8b887f; --line: #e8e6df;
  --tint: #ffefc2; --tint-2: #ffe08a; --yellow: #ffb81c; --orange: #f39200; --red: #c8102e; --red-soft: #fde7ea;
  --green: #1b8a57; --green-soft: #e2f4ea; --blue: #2460a8; --blue-soft: #e5eefa;
  --r-lg: 20px; --r: 14px; --r-sm: 10px;
  --shadow: 0 1px 0 rgba(20, 20, 19, .03), 0 10px 28px -16px rgba(20, 20, 19, .18);
  --font: "Outfit", "Urbanist", "Avenir Next", "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --side: 264px; --ease: cubic-bezier(.22, .8, .24, 1);
}
@property --a { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --b { syntax: '<length>'; inherits: false; initial-value: 0px; }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--canvas); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.015em; }
h1 { font-size: 30px; font-weight: 500; letter-spacing: -.03em; } h2 { font-size: 16px; } h3 { font-size: 15px; } h4 { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
p { margin: 0 0 8px; } a { color: var(--ink); text-underline-offset: 3px; }
code, .mono { font-family: var(--mono); font-size: 11.8px; }
code { background: var(--soft); padding: 1px 6px; border-radius: 6px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.row { display: flex; gap: 10px; align-items: center; } .row.wrap { flex-wrap: wrap; } .spacer { flex: 1; }
.grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.stack-y { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; } .filters > label.f { flex: 1 1 170px; margin: 0; } .filters > label.f.narrow { flex: 0 1 130px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; }
.split-aside { grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
.split-wide { grid-template-columns: 400px minmax(0, 1fr); align-items: start; }
.split-form { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
.split-toc { grid-template-columns: 230px minmax(0, 1fr); align-items: start; }
.panel-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 250px; }
.fields-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.span-2 { grid-column: span 2; }

/* Marque */
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 36px; height: 36px; border-radius: 50%; background: var(--ink); position: relative; flex: none; }
.brand-mark::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; border: 4px solid var(--yellow); border-right-color: transparent; transform: rotate(-45deg); }
.brand-mark::after { content: ""; position: absolute; right: 7px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.brand-name { font-weight: 600; font-size: 16px; line-height: 1.1; white-space: nowrap; } .brand-name span { font-weight: 400; }
.brand-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* Connexion */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 14px; padding: 14px; }
.login-left { background: var(--ink); color: #fff; border-radius: 28px; padding: 40px 44px; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; position: relative; overflow: hidden; }
.login-left .brand-name { color: #fff; } .login-left .brand-mark { background: #fff; } .login-left .brand-mark::before { border-color: var(--ink); border-right-color: transparent; }
.login-left h1 { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.08; max-width: 520px; margin-bottom: 14px; }
.login-left h1 em { font-style: normal; color: var(--yellow); }
.login-left p { color: #c9c6bd; max-width: 460px; font-size: 15.5px; }
.login-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 520px; }
.login-tile { background: #23221f; border-radius: 16px; padding: 14px 16px; } .login-tile b { display: block; font-size: 22px; font-weight: 500; letter-spacing: -.02em; } .login-tile span { color: #a9a69d; font-size: 12.5px; }
.login-tile.t { background: var(--yellow); color: var(--ink); } .login-tile.t span { color: #5c4500; }
.login-right { display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-box { width: 100%; max-width: 410px; }
.pick { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); background: var(--surface); cursor: pointer; text-align: left; font: inherit; width: 100%; border: 0; color: inherit; text-decoration: none; box-shadow: var(--shadow); transition: transform .18s var(--ease), background .18s; }
.pick:hover { transform: translateY(-1px); background: #fffdf6; } .pick.on { background: var(--tint); box-shadow: none; }
.pick-list { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--tint); color: var(--ink); display: grid; place-items: center; font-weight: 600; font-size: 12px; flex: none; }
.avatar.k { background: var(--ink); color: var(--yellow); }

/* Structure */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .3s var(--ease); }
.app.mini { --side: 76px; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 14px 12px 12px; gap: 10px; min-width: 0; z-index: 40; background: var(--canvas); }
.side-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 4px; }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; flex: none; position: relative; }
.icon-btn:hover { background: rgba(20, 20, 19, .06); } .icon-btn svg { width: 17px; height: 17px; }
.icon-btn.round { background: var(--surface); border-radius: 50%; box-shadow: var(--shadow); }
.icon-btn .dot { position: absolute; right: -2px; top: -3px; min-width: 16px; height: 16px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; font-weight: 600; display: grid; place-items: center; padding: 0 4px; }
.search-btn { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 11px; border-radius: var(--r-sm); border: 0; background: var(--surface); color: var(--muted); font: inherit; cursor: pointer; box-shadow: var(--shadow); }
.search-btn svg { width: 16px; height: 16px; flex: none; } .search-btn kbd { margin-left: auto; font: 500 10.5px var(--font); background: var(--soft); border-radius: 6px; padding: 2px 6px; color: var(--muted); }
.nav { position: relative; overflow: auto; flex: 1; min-height: 0; padding: 2px 0; scrollbar-width: none; } .nav::-webkit-scrollbar { display: none; }
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 14px 12px 6px; white-space: nowrap; }
.nav a { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--r-sm); color: var(--ink-2); text-decoration: none; font-size: 14px; white-space: nowrap; transition: color .2s; }
.nav a:hover { color: var(--ink); background: rgba(20, 20, 19, .045); } .nav a.active { color: var(--ink); font-weight: 500; background: transparent; }
.nav a svg { width: 17px; height: 17px; flex: none; }
.nav .cnt { margin-left: auto; background: var(--ink); color: #fff; border-radius: 9px; font-size: 10.5px; padding: 1px 7px; font-weight: 500; } .nav .cnt.r { background: var(--red); }
.nav-pill { position: absolute; left: 0; right: 0; top: 0; background: var(--tint); z-index: 0; pointer-events: none; clip-path: inset(var(--a) 0 var(--b) 0 round 10px); }
.queue { background: var(--ink); color: #fff; border-radius: var(--r); padding: 12px 14px; text-decoration: none; display: block; }
.queue b { font-size: 19px; font-weight: 500; } .queue small { color: #a9a69d; font-size: 12px; }
.dots { display: flex; gap: 4px; margin-top: 8px; } .dots i { width: 6px; height: 6px; border-radius: 50%; background: #4a4944; flex: none; } .dots i.on { background: var(--yellow); } .dots i.al { background: #ff5a6e; }
.me { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: var(--r); padding: 8px 10px; box-shadow: var(--shadow); min-width: 0; }
.me b { display: block; font-size: 13px; font-weight: 500; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .me span { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.me > div:nth-child(2) { min-width: 0; flex: 1; }
.credit { font-size: 11px; color: var(--muted); padding: 2px 6px 0; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.credit b { color: var(--ink); font-weight: 600; letter-spacing: .06em; } .credit i { width: 16px; height: 16px; border-radius: 5px; background: var(--ink); color: var(--yellow); display: grid; place-items: center; font: 700 9px var(--font); font-style: normal; flex: none; }
.app.mini .side .brand > div:last-child, .app.mini .nav-group, .app.mini .nav a span, .app.mini .nav .cnt, .app.mini .search-btn span, .app.mini .search-btn kbd, .app.mini .queue small, .app.mini .queue .dots, .app.mini .me > div:nth-child(2), .app.mini .me .icon-btn, .app.mini .credit span { display: none; }
.app.mini .side-head { flex-direction: column; } .app.mini .nav a, .app.mini .search-btn { justify-content: center; padding-left: 0; padding-right: 0; } .app.mini .queue { text-align: center; padding: 10px 4px; } .app.mini .me { justify-content: center; padding: 8px 0; } .app.mini .credit { justify-content: center; }
.app.mini .nav-group { display: block; height: 14px; padding: 0; font-size: 0; }
.main { min-width: 0; padding: 14px 14px 14px 0; }
.shell { background: var(--soft); border-radius: 26px; min-height: calc(100vh - 28px); display: flex; flex-direction: column; }
.top { padding: 14px 24px 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-width: 0; } .crumb b { color: var(--ink); font-weight: 500; } .crumb a { color: inherit; text-decoration: none; }
.status { display: inline-flex; align-items: center; gap: 7px; background: var(--tint); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; white-space: nowrap; } .status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(27, 138, 87, .18); }
.year { background: var(--surface); border-radius: 999px; padding: 3px 4px 3px 12px; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); box-shadow: var(--shadow); }
.year select { border: 0; background: transparent; margin: 0; padding: 4px 4px; width: auto; font-weight: 500; color: var(--ink); }
.burger { display: none; }
.content { padding: 18px 24px 40px; width: 100%; max-width: 1400px; }
.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; } .page-head p { color: var(--muted); margin: 6px 0 0; max-width: 760px; font-size: 14.5px; }
.scrim { display: none; }

/* Entrée des écrans */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.enter > * { animation: rise .5s var(--ease) both; }
.enter > *:nth-child(2) { animation-delay: .05s; } .enter > *:nth-child(3) { animation-delay: .1s; } .enter > *:nth-child(4) { animation-delay: .15s; } .enter > *:nth-child(5) { animation-delay: .2s; } .enter > *:nth-child(n+6) { animation-delay: .25s; }
.enter .stagger > * { animation: rise .5s var(--ease) both; } .enter .stagger > *:nth-child(2) { animation-delay: .06s; } .enter .stagger > *:nth-child(3) { animation-delay: .12s; } .enter .stagger > *:nth-child(4) { animation-delay: .18s; } .enter .stagger > *:nth-child(n+5) { animation-delay: .24s; }

/* Cartes */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); min-width: 0; }
.card-h { padding: 16px 20px 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-h .sub { font-size: 12.5px; color: var(--muted); font-weight: 400; flex-basis: 100%; margin-top: -6px; }
.card-h.inline .sub { flex-basis: auto; margin: 0; }
.card-b { padding: 16px 20px 20px; }
.card.dark { background: var(--ink); color: #fff; } .card.dark .muted, .card.dark .sub { color: #a9a69d; }
.card.tint { background: var(--tint); box-shadow: none; }
.tw { overflow-x: auto; padding: 6px 8px 8px; }

/* Boutons */
.btn { font: 500 13.5px var(--font); padding: 9px 15px; border-radius: 999px; border: 0; background: var(--surface); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; white-space: nowrap; box-shadow: var(--shadow); transition: transform .15s var(--ease), background .15s, opacity .15s; }
.btn:hover { transform: translateY(-1px); } .btn:active { transform: scale(.97); }
.btn svg { width: 15px; height: 15px; flex: none; }
.btn.primary { background: var(--ink); color: #fff; } .btn.primary svg { color: var(--yellow); }
.btn.accent { background: var(--yellow); color: var(--ink); }
.btn.ghost { background: var(--soft); box-shadow: none; } .card .btn:not(.primary):not(.accent):not(.danger) { background: var(--soft); box-shadow: none; }
.btn.danger { background: var(--red-soft); color: var(--red); box-shadow: none; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; } .btn.icon { padding: 7px; border-radius: 10px; } .btn.block { width: 100%; }
.btn[disabled] { opacity: .4; cursor: not-allowed; transform: none; }

/* Formulaires */
label.f { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 13px; min-width: 0; }
label.f .req { color: var(--red); } label.f .hint { display: block; font-weight: 400; color: var(--muted); font-size: 11.8px; margin-top: 4px; }
input[type=text], input[type=password], input[type=number], input[type=email], input[type=search], select, textarea {
  font: 400 14px var(--font); width: 100%; padding: 9px 12px; border: 1.5px solid transparent; border-radius: var(--r-sm); background: var(--soft); color: var(--ink); margin-top: 5px; transition: border-color .15s, background .15s; min-width: 0; }
.shell > .content input[type=text], .shell > .content select { }
input:hover, select:hover { background: #f1f0eb; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--yellow); background: #fff; }
input[readonly], input[disabled], select[disabled] { color: var(--muted); background: repeating-linear-gradient(135deg, var(--soft), var(--soft) 6px, #f1f0eb 6px, #f1f0eb 12px); }
input.invalid, select.invalid { border-color: var(--red); background: #fff8f9; }
input[type=file] { font: inherit; font-size: 13px; max-width: 100%; }
input[type=file]::file-selector-button { font: 500 12.5px var(--font); border: 0; border-radius: 999px; padding: 7px 12px; margin-right: 10px; background: var(--ink); color: #fff; cursor: pointer; }
.check { display: flex; align-items: center; gap: 9px; font-weight: 500; font-size: 13px; cursor: pointer; }
input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; border-radius: 6px; background: var(--soft); border: 1.5px solid #d6d3ca; margin: 0; cursor: pointer; display: inline-grid; place-items: center; transition: background .15s, border-color .15s; flex: none; vertical-align: middle; }
input[type=checkbox]:checked { background: var(--ink); border-color: var(--ink); } input[type=checkbox]:checked::after { content: ""; width: 9px; height: 5px; border-left: 2px solid var(--yellow); border-bottom: 2px solid var(--yellow); transform: rotate(-45deg) translateY(-1px); }
input[type=checkbox].sw { width: 38px; height: 22px; border-radius: 999px; border: 0; background: #dcd9d0; justify-items: start; padding: 3px; } input[type=checkbox].sw::after { content: ""; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 0; transform: none; transition: transform .2s var(--ease); }
input[type=checkbox].sw:checked { background: var(--ink); } input[type=checkbox].sw:checked::after { transform: translateX(16px); border: 0; width: 16px; height: 16px; }

/* Tableaux */
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font-size: 12px; color: var(--muted); padding: 9px 12px; font-weight: 400; white-space: nowrap; }
table.t td { padding: 11px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
table.t tr:hover td { background: #fbfaf7; }
table.t td.id { font-family: var(--mono); font-size: 11.3px; color: var(--ink-2); max-width: 230px; min-width: 150px; word-break: break-all; }
tr.sel td { background: #fffaea !important; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.8px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: var(--soft); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--green-soft); color: var(--green); } .badge.err { background: var(--red-soft); color: var(--red); }
.badge.warn { background: var(--tint); color: #7a5600; } .badge.info { background: var(--blue-soft); color: var(--blue); }
.badge.dark { background: var(--ink); color: #fff; font-family: var(--mono); font-size: 11px; }
.pager { display: flex; align-items: center; gap: 6px; justify-content: center; padding: 4px 12px 14px; font-size: 12.5px; color: var(--muted); }

/* Onglets à indicateur glissant */
.tabs { position: relative; display: flex; gap: 4px; padding: 10px 14px 0; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); } .tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { position: relative; z-index: 1; font: 400 14px var(--font); background: none; border: 0; padding: 9px 12px 12px; cursor: pointer; color: var(--muted); text-decoration: none; white-space: nowrap; transition: color .2s; }
.tabs .active { color: var(--ink); font-weight: 500; }
.tabs .pill { position: absolute; left: 0; bottom: 0; height: 2.5px; background: var(--ink); pointer-events: none; clip-path: inset(0 var(--b) 0 var(--a) round 3px); }
.seg { position: relative; display: inline-flex; background: var(--soft); border-radius: 999px; padding: 3px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg a, .seg button { position: relative; z-index: 1; font: 400 13px var(--font); border: 0; background: none; padding: 6px 13px; border-radius: 999px; cursor: pointer; color: var(--muted); text-decoration: none; white-space: nowrap; } .seg .active { color: var(--ink); font-weight: 500; }
.seg .pill { position: absolute; left: 0; top: 3px; bottom: 3px; background: var(--surface); pointer-events: none; clip-path: inset(0 var(--b) 0 var(--a) round 999px); }

.note { background: var(--tint); padding: 12px 15px; border-radius: var(--r); font-size: 13.5px; }
.note.err { background: var(--red-soft); } .note.ok { background: var(--green-soft); } .note.info { background: var(--blue-soft); }
.note ul { margin: 5px 0 0; padding-left: 18px; }

/* Tuiles */
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-height: 124px; }
.kpi .l { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 7px; } .kpi .l svg { width: 15px; height: 15px; }
.kpi .v { font-size: 32px; font-weight: 500; letter-spacing: -.03em; line-height: 1; margin-top: auto; } .kpi .v small { font-size: 15px; color: var(--muted); font-weight: 400; margin-left: 6px; letter-spacing: 0; }
.kpi .s { font-size: 12.5px; color: var(--muted); }
.kpi.tint .l, .kpi.tint .s { color: #6b5300; } .kpi.dark .l, .kpi.dark .s { color: #a9a69d; } .kpi.dark .v small { color: #a9a69d; }
.bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--soft); gap: 2px; } .bar i { display: block; height: 100%; border-radius: 3px; transition: flex-grow .9s var(--ease); flex: 0 1 0; min-width: 0; }
.legend { display: grid; gap: 10px; margin-top: 16px; grid-template-columns: minmax(0, 1fr); } .legend div { display: flex; align-items: center; gap: 9px; font-size: 13.5px; } .legend i { width: 9px; height: 9px; border-radius: 3px; flex: none; } .legend b { margin-left: auto; font-weight: 500; }

/* Étapes */
.steps { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.step { background: var(--soft); border-radius: var(--r); padding: 12px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 3px; min-height: 96px; transition: transform .18s var(--ease), background .18s; }
.step:hover { transform: translateY(-2px); }
.step .dot { width: 24px; height: 24px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 500; font-size: 12px; color: var(--muted); margin-bottom: auto; }
.step b { font-size: 13.5px; font-weight: 500; } .step span { color: var(--muted); font-size: 12px; }
.step.done .dot { background: var(--ink); color: var(--yellow); } .step.now { background: var(--tint); } .step.now .dot { background: var(--yellow); color: var(--ink); } .step.now span { color: #6b5300; }
.step.alert { background: var(--red-soft); } .step.alert .dot { background: var(--red); color: #fff; } .step.alert span { color: var(--red); }

/* Fenêtre de code */
.code { background: #0f1420; border-radius: var(--r); overflow: hidden; }
.code-h { display: flex; align-items: center; gap: 6px; padding: 10px 14px; color: #8d97ad; font: 12px var(--mono); border-bottom: 1px solid #1c2333; }
.code-h i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; } .code-h i:nth-child(2) { background: #febc2e; } .code-h i:nth-child(3) { background: #28c840; margin-right: 8px; }
.code-h span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .code-h button { font: 500 10.5px var(--font); background: #1c2333; color: #c5cde0; border: 0; border-radius: 6px; padding: 3px 8px; cursor: pointer; }
pre.xml { margin: 0; color: #d7deee; padding: 14px 16px; font-family: var(--mono); font-size: 11.8px; line-height: 1.6; overflow: auto; max-height: 520px; white-space: pre; }
pre.xml .t { color: #ffcf5c; } pre.xml .a { color: #8ec7ff; } pre.xml .v { color: #a6e3a1; } pre.xml .c { color: #6c7690; }
.pipe { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.pipe-row { display: grid; grid-template-columns: 26px minmax(0, 1.3fr) minmax(0, 1fr) 14px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--r-sm); background: var(--soft); font-size: 13px; }
.pipe-row .n { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--yellow); display: grid; place-items: center; font-size: 11.5px; font-weight: 600; }
.pipe-row.todo { opacity: .5; } .pipe-row .file { font-family: var(--mono); font-size: 11.3px; word-break: break-all; }
.formula { font-family: var(--mono); font-size: 12.3px; background: #0f1420; color: #ffcf5c; padding: 11px 14px; border-radius: var(--r-sm); overflow: auto; margin-top: 6px; white-space: nowrap; }
.formula span { color: #a6e3a1; }
.tree { font-family: var(--mono); font-size: 12.5px; line-height: 1.9; overflow-x: auto; white-space: nowrap; } .tree .n { display: inline-block; padding: 0 9px; border-radius: 7px; background: var(--soft); } .tree .y { background: var(--tint-2); }
.uc { border-radius: var(--r-lg); padding: 16px; background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; transition: transform .2s var(--ease); min-width: 0; } .uc:hover { transform: translateY(-2px); }
.uc .num { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--yellow); display: grid; place-items: center; font-weight: 600; font-size: 12.5px; flex: none; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.toc { display: grid; gap: 2px; position: sticky; top: 14px; } .toc a { color: var(--ink-2); text-decoration: none; padding: 7px 10px; border-radius: 9px; font-size: 13.5px; } .toc a:hover { background: var(--soft); color: var(--ink); }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; font-size: 13px; } .facts .muted { font-size: 12px; margin-bottom: 2px; } .facts b { font-weight: 500; word-break: break-word; }

/* Modale, palette, toasts */
.modal-bg { position: fixed; inset: 0; background: rgba(20, 20, 19, .42); backdrop-filter: blur(3px); z-index: 100; display: grid; place-items: center; padding: 18px; animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } } @keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.modal { background: var(--surface); border-radius: 22px; width: 100%; max-width: 620px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45); animation: pop .28s var(--ease) both; }
.modal.wide { max-width: 1000px; } .modal .card-b { overflow: auto; } .modal-f { padding: 12px 20px 16px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.palette { background: var(--surface); border-radius: 20px; width: 100%; max-width: 580px; align-self: start; margin-top: 9vh; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45); overflow: hidden; animation: pop .25s var(--ease) both; }
.palette input { border-radius: 0; background: #fff; padding: 16px 20px; font-size: 16px; margin: 0; border: 0; border-bottom: 1px solid var(--line); }
.palette-list { max-height: 52vh; overflow: auto; padding: 8px; } .palette-list a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--r-sm); text-decoration: none; color: var(--ink); font-size: 14px; }
.palette-list a.on, .palette-list a:hover { background: var(--tint); } .palette-list a svg { width: 16px; height: 16px; flex: none; color: var(--ink-2); } .palette-list a small { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; padding-left: 10px; }
.palette-list a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .palette-list h4 { padding: 8px 12px 4px; }
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 300; display: grid; gap: 8px; max-width: calc(100vw - 36px); }
.toast { background: var(--ink); color: #fff; padding: 11px 16px 11px 14px; border-radius: var(--r); font-size: 13.5px; box-shadow: 0 16px 40px -14px rgba(0, 0, 0, .5); max-width: 420px; display: flex; gap: 10px; align-items: flex-start; animation: pop .3s var(--ease) both; }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); margin-top: 6px; flex: none; } .toast.err::before { background: #ff5a6e; } .toast.ok::before { background: #4fd08f; }

/* Visite guidée */
.tour-hole { position: fixed; z-index: 200; border-radius: 22px; box-shadow: 0 0 0 9999px rgba(20, 20, 19, .6); outline: 2.5px solid var(--yellow); outline-offset: 2px; pointer-events: none; transition: left .45s var(--ease), top .45s var(--ease), width .45s var(--ease), height .45s var(--ease); }
.tour-block { position: fixed; inset: 0; z-index: 199; }
.tour-tip { position: fixed; z-index: 201; width: 420px; max-width: calc(100vw - 24px); background: var(--ink); color: #fff; border-radius: 22px; box-shadow: 0 30px 70px -18px rgba(0, 0, 0, .6); transition: left .45s var(--ease), top .45s var(--ease); overflow: hidden; }
.tour-tip .tb { padding: 18px 20px 4px; } .tour-tip .chap { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--yellow); margin-bottom: 8px; }
.tour-tip h3 { margin-bottom: 7px; font-size: 19px; font-weight: 500; letter-spacing: -.02em; } .tour-tip p { font-size: 14px; color: #d3d0c8; margin: 0; } .tour-tip code { background: #2a2925; color: #ffe08a; }
.tour-tip .dots { flex-wrap: wrap; padding: 12px 20px 0; margin: 0; } .tour-tip .dots i { cursor: pointer; }
.tour-tip .tf { padding: 12px 20px 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .tour-tip .prog { font-size: 12px; color: #a9a69d; }
.tour-tip .btn { background: #2a2925; color: #fff; box-shadow: none; } .tour-tip .btn.accent { background: var(--yellow); color: var(--ink); }
.tour-tip .busy { display: inline-block; width: 13px; height: 13px; border-radius: 50%; border: 2px solid rgba(20, 20, 19, .25); border-top-color: var(--ink); animation: spin .7s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
.tour-chapters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 12px; } .tour-chapters button { font: 400 13px var(--font); text-align: left; background: #23221f; color: #e9e6de; border: 0; border-radius: 10px; padding: 8px 10px; cursor: pointer; display: flex; gap: 8px; align-items: center; } .tour-chapters button:hover { background: #33322d; } .tour-chapters b { color: var(--yellow); font-weight: 500; width: 14px; }

/* Adaptation aux écrans */
@media (max-width: 1280px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g2.stack, .split-form, .split-wide { grid-template-columns: minmax(0, 1fr); } .panel-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .panel-3 > :last-child { grid-column: span 2; } }
@media (max-width: 1080px) { .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split-aside, .split-toc { grid-template-columns: minmax(0, 1fr); } .toc { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); } .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .status { display: none; } }
@media (max-width: 900px) {
  .app, .app.mini { grid-template-columns: minmax(0, 1fr); --side: 284px; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 284px; transform: translateX(-105%); transition: transform .32s var(--ease); box-shadow: 0 0 60px rgba(0, 0, 0, .25); border-radius: 0 24px 24px 0; height: auto; }
  .app.open .side { transform: none; } .app.open .scrim { display: block; position: fixed; inset: 0; background: rgba(20, 20, 19, .4); z-index: 39; }
  .app.mini .side .brand > div:last-child, .app.mini .nav a span, .app.mini .search-btn span, .app.mini .me > div:nth-child(2), .app.mini .credit span, .app.mini .queue small { display: revert; } .app.mini .queue .dots { display: flex; } .app.mini .nav a, .app.mini .search-btn { justify-content: flex-start; padding: 9px 12px; }
  .burger { display: grid; } .collapse-btn { display: none; }
  .main { padding: 8px; } .shell { border-radius: 20px; min-height: calc(100vh - 16px); } .top { padding: 12px 14px 0; } .content { padding: 14px 14px 32px; }
  h1 { font-size: 25px; } .login { grid-template-columns: minmax(0, 1fr); } .login-left { padding: 28px; }
  .hide-sm { display: none !important; } .tour-tip { width: 360px; }
}
@media (max-width: 640px) {
  .g2, .g3, .g4, .fields-2, .panel-3, .login-tiles, .toc, .tour-chapters { grid-template-columns: minmax(0, 1fr); } .panel-3 > :last-child, .span-2 { grid-column: auto; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .facts { grid-template-columns: minmax(0, 1fr); } .crumb span, .crumb a { display: none; }
  .pipe-row { grid-template-columns: 26px minmax(0, 1fr); } .pipe-row > :nth-child(3), .pipe-row > :nth-child(4) { display: none; } .pipe-row > :nth-child(5) { grid-column: 2; }
  .card-b { padding: 14px; } .card-h { padding: 14px 14px 0; } .btn.block-sm { width: 100%; } .year span { display: none; } .year { padding-left: 6px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .side, .top, .no-print, #toasts, #tour-layer { display: none !important; } .app { display: block; } .main { padding: 0; } .shell { background: #fff; } .card { box-shadow: none; } .code { background: #fff; } .code-h { display: none; } pre.xml { max-height: none; color: #000; border: 1px solid #ccc; } pre.xml span { color: #000 !important; } }
