/* Shift CFO — styles communs aux outils F12 */
.tool-page { max-width: 1120px; margin: 0 auto; padding-left: var(--gutter); padding-right: max(20px, env(safe-area-inset-right, 0px)); padding-block: 28px 72px; display: flex; flex-direction: column; gap: 28px; }
.tool-page.narrow { max-width: 920px; }
.tool-head { display: flex; flex-direction: column; gap: 14px; }
.tool-head h1 { font-size: clamp(32px, 5.4vw, 48px); line-height: 1.08; letter-spacing: -0.02em; }
.tool-head .lead { max-width: 64ch; font-size: 17px; color: var(--slate); }
.tool-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; color: var(--slate); }
.tool-meta b { color: var(--navy); font-weight: 600; }
.note { margin: 0; font-size: 14px; color: var(--slate); }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: clamp(18px, 3vw, 24px); display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.panel h2 { margin: 0; font-size: 22px; letter-spacing: -0.01em; }
.panel h2 .hand, .panel h3 .hand { font-weight: 700; font-size: 24px; }
.panel h3 { margin: 0; font-size: 20px; }

/* Lecteur */
.drop { border: 2px dashed var(--mist); border-radius: 16px; background: var(--white); padding: clamp(20px, 3vw, 28px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--jade); background: var(--jade-soft); }
.drop p { margin: 0; }
.drop .hand { font-size: 22px; }
.drop .small { font-size: 14px; color: var(--slate); }
.status { margin: -12px 0 0; font-size: 15px; color: var(--slate); }
.status.err { color: var(--warn); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 14px; background: var(--ground); overflow-wrap: anywhere; }
.chip b { font-weight: 600; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.party { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.party .role { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--slate); }
.party .name { font-size: 19px; font-weight: 700; overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 15px; margin: 0; }
.kv dt { color: var(--slate); }
.kv dd { margin: 0; font-family: var(--mono); font-size: 14px; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 12px; }
.fact { background: var(--ground); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fact span { font-size: 13px; color: var(--slate); }
.fact strong { font-family: var(--mono); font-weight: 500; font-size: 15px; overflow-wrap: anywhere; }
.fact.big strong { font-size: 20px; font-weight: 700; color: var(--jade); }
.tablebox { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.tablebox table { border-collapse: collapse; width: 100%; font-size: 14px; }
.tablebox th, .tablebox td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tablebox th { background: var(--ground); font-weight: 600; font-size: 13px; color: var(--slate); white-space: nowrap; }
.tablebox td.num, .tablebox th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); white-space: nowrap; }
.tablebox tr:last-child td { border-bottom: none; }
.checks { display: flex; flex-direction: column; gap: 8px; }
.check { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--ground); }
.pill { border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--jade-soft); color: var(--jade); }
.pill.ko { background: var(--warn-soft); color: var(--warn); }
.check .why { font-size: 13px; color: var(--slate); }
.check code { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
@media (max-width: 560px) { .check { grid-template-columns: auto 1fr; } .check code { grid-column: 2; } }
.treebar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.treebar input { flex: 1 1 260px; min-width: 0; padding: 10px 12px; border: 1px solid var(--mist); border-radius: 8px; background: var(--white); font-size: 15px; }
.tree { font-family: var(--mono); font-size: 13.5px; background: #F7F9FB; border: 1px solid var(--line); border-radius: 12px; padding: 12px; overflow-x: auto; max-height: 640px; overflow-y: auto; }
.tree details { margin-left: 14px; }
.tree > details { margin-left: 0; }
.tree summary { cursor: pointer; padding: 3px 4px; border-radius: 4px; }
.tree summary:hover, .leaf:hover { background: var(--jade-soft); }
.leaf { margin-left: 28px; padding: 3px 4px; border-radius: 4px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.tag { color: var(--jade); font-weight: 500; }
.pfx { color: var(--slate); }
.tree .lbl { font-family: var(--sans); font-size: 12.5px; color: var(--navy); background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; }
.val { color: var(--navy); font-weight: 700; overflow-wrap: anywhere; }
.attr { color: var(--slate); font-size: 12.5px; }
.flat .row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.flat .path { color: var(--slate); overflow-wrap: anywhere; }
.flat .path b { color: var(--jade); font-weight: 500; }
.tree .empty { font-family: var(--hand); font-size: 20px; color: var(--slate); margin: 0; }

/* Prêt pour l'émission ? */
.progress { position: sticky; top: 78px; z-index: 5; background: var(--ground); padding: 10px 0; display: flex; align-items: center; gap: 14px; }
.pbar { flex: 1; height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.pbar i { display: block; height: 100%; width: 0; background: var(--jade); border-radius: 999px; transition: width .2s; }
.progress span { font-family: var(--mono); font-size: 14px; white-space: nowrap; }
.theme { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 22px 22px 8px; display: flex; flex-direction: column; min-width: 0; }
.theme header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.theme .num { font-family: var(--mono); font-weight: 700; font-size: 13px; background: var(--white); border: 1.5px solid var(--navy); border-bottom-width: 4px; border-radius: 6px; padding: 2px 8px; }
.theme h2 { margin: 0; font-size: 21px; letter-spacing: -0.01em; }
.theme .why { margin: 0 0 8px; font-family: var(--hand); font-size: 18px; color: var(--jade); }
.q { border: none; margin: 0; padding: 14px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.q legend { padding: 0; font-weight: 600; float: left; width: 100%; }
.q .hint { font-size: 14px; color: var(--slate); clear: both; margin: 0; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; clear: both; }
.opts label { position: relative; cursor: pointer; }
.opts input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opts span { display: inline-block; border: 1.5px solid var(--line); border-radius: 8px; padding: 8px 14px; font-size: 15px; background: var(--white); transition: border-color .12s, background .12s; }
.opts label:hover span { border-color: var(--slate); }
.opts input:checked + span { border-color: var(--jade); background: var(--jade-soft); font-weight: 600; }
.opts input:focus-visible + span { outline: 3px solid var(--emerald); outline-offset: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
#result { display: flex; flex-direction: column; gap: 22px; scroll-margin-top: 140px; }
.verdict { background: var(--navy); color: var(--white); border-radius: 16px; padding: 28px; display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.verdict .score { font-family: var(--mono); font-weight: 700; font-size: 56px; line-height: 1; color: var(--emerald); }
.verdict .score small { font-size: 20px; color: var(--mist); }
.verdict h2 { margin: 0 0 6px; font-size: 28px; letter-spacing: -0.01em; }
.verdict p { margin: 0; color: var(--mist); }
.trow { display: grid; grid-template-columns: minmax(0, 220px) 1fr 52px; gap: 14px; align-items: center; font-size: 15px; }
.trow .pbar { height: 12px; }
.trow .pct { font-family: var(--mono); text-align: right; }
.chantiers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; counter-reset: c; }
.chantiers li { counter-increment: c; display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 16px; border-radius: 12px; background: var(--ground); }
.chantiers li::before { content: counter(c); font-family: var(--mono); font-weight: 700; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: var(--jade); color: var(--white); border-bottom: 4px solid var(--navy); }
.chantiers strong { display: block; font-size: 16px; }
.chantiers span { font-size: 14px; color: var(--slate); }
.unknown { padding: 14px 16px; border-radius: 12px; background: var(--warn-soft); font-size: 15px; }
.unknown b { color: var(--warn); }
.cta { background: var(--white); border: 1.5px solid var(--jade); border-radius: 16px; padding: 22px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.cta p { margin: 0; max-width: 52ch; }
.cta .hand { font-size: 22px; font-weight: 700; display: block; }
.refs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 22px; }
.refs h3 { font-size: 15px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--slate); margin-bottom: 10px; }
.refs ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.refs li { display: flex; flex-direction: column; gap: 2px; padding-left: 14px; border-left: 3px solid var(--jade-soft); }
.refs a { font-weight: 600; text-decoration: none; }
.refs a:hover { text-decoration: underline; }
.refs a::after { content: " ↗"; font-weight: 400; }
.refs li span { font-size: 14px; color: var(--slate); line-height: 1.45; }
@media (max-width: 560px) {
  .verdict { grid-template-columns: 1fr; gap: 12px; padding: 22px; }
  .trow { grid-template-columns: 1fr 48px; }
  .trow .pbar { grid-column: 1 / -1; grid-row: 2; }
  .theme { padding: 18px 16px 6px; }
  .progress { top: 76px; }
}
