/* Habillage « Apple » des écrans Tunnel / Intégrations : typographie système, grands titres, cartes douces, boutons en pilule. Portée : .ap */
body:has(.ap) { background: #f5f5f7; }
.ap { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Inter, "Segoe UI", Roboto, sans-serif; color: #1d1d1f; -webkit-font-smoothing: antialiased; max-width: 1040px; padding-top: 1.5rem; padding-bottom: 3rem; }
.ap h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 700; letter-spacing: -.025em; line-height: 1.1; margin: 0; }
.ap h2 { font-size: 1.5rem; font-weight: 650; letter-spacing: -.02em; margin: 0; }
.ap h3 { font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; margin: 0 0 .6rem; }
.ap .text-body-secondary, .ap .ap-sub, .ap .ap-note, .ap small { color: #6e6e73 !important; }
.ap .ap-sub { font-size: 1.1rem; margin: .5rem 0 0; max-width: 46rem; line-height: 1.45; }
.ap .ap-note { font-size: .875rem; }
.ap > .card.shadow-sm.mb-3:first-child:only-of-type { }

.ap .card { border: 0; border-radius: 22px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 24px rgba(0,0,0,.05) !important; }
.ap .btn { border-radius: 980px; padding: .5rem 1.15rem; font-weight: 500; transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease; }
.ap .btn:active { transform: scale(.98); }
.ap .btn-lg { padding: .75rem 1.8rem; font-size: 1.05rem; }
.ap .btn-sm { padding: .3rem .8rem; }
.ap .btn-link { text-decoration: none; }
.ap .btn-link:hover { text-decoration: underline; }
.ap .btn-outline-primary, .ap .btn-outline-secondary { background: rgba(0,0,0,.04); border-color: transparent; color: var(--bs-primary, #0071e3); }
.ap .btn-outline-danger { border-color: transparent; background: rgba(255,59,48,.08); }
.ap .form-control, .ap .form-select, .ap textarea { border-radius: 12px; border: 1px solid #d2d2d7; background-color: #fff; padding: .65rem .9rem; font-size: 1rem; }
.ap .form-control:focus, .ap .form-select:focus { border-color: var(--bs-primary, #0071e3); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bs-primary, #0071e3) 22%, transparent); }
.ap :focus-visible { outline: 3px solid color-mix(in srgb, var(--bs-primary, #0071e3) 55%, transparent); outline-offset: 2px; }
.ap .alert { border: 0; border-radius: 16px; }
.ap-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; }
.ap-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.ap-back { display: inline-block; font-size: .95rem; text-decoration: none; margin-bottom: .5rem; }
.ap-empty { display: grid; gap: .35rem; justify-items: center; text-align: center; background: #fff; border-radius: 22px; padding: 2.5rem 1.5rem; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 24px rgba(0,0,0,.05); }
.ap-empty span { color: #6e6e73; }
.ap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.25rem; }
.ap-card { background: #fff; border-radius: 22px; padding: 1.5rem; display: grid; gap: 1.1rem; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 24px rgba(0,0,0,.05); transition: box-shadow .2s ease, transform .2s ease; }
.ap-card:hover { box-shadow: 0 2px 4px rgba(0,0,0,.05), 0 14px 36px rgba(0,0,0,.09); transform: translateY(-2px); }
.ap-card-top { display: flex; justify-content: space-between; gap: .75rem; align-items: flex-start; }
.ap-card-top h2 { font-size: 1.2rem; }
.ap-card-foot { display: flex; align-items: center; gap: .5rem; }
.ap-card-foot form { margin: 0; }
.ap-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: 0; }
.ap-stats div { display: grid; gap: .1rem; }
.ap-stats dt { font-size: .72rem; font-weight: 500; color: #6e6e73; text-transform: uppercase; letter-spacing: .04em; }
.ap-stats dd { margin: 0; font-size: 1.15rem; font-weight: 600; letter-spacing: -.01em; }
.ap-pill { display: inline-block; font-size: .78rem; font-weight: 600; padding: .2rem .65rem; border-radius: 980px; background: #e8e8ed; color: #424245; white-space: nowrap; }
.ap-pill.ap-on { background: #d9f5e1; color: #0a6b2d; }
.ap-section { background: #fff; border-radius: 22px; padding: 1.75rem; display: grid; gap: 1.25rem; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 24px rgba(0,0,0,.05); }
.ap-steps { display: grid; gap: 1.5rem; }
.ap-step { display: grid; grid-template-columns: 2rem 1fr; gap: 1rem; align-items: start; }
.ap-num { width: 2rem; height: 2rem; border-radius: 50%; background: var(--bs-primary, #0071e3); color: #fff; font-weight: 600; display: grid; place-items: center; font-size: .95rem; }
.ap-step-body h3 small { font-weight: 400; color: #6e6e73; }
.ap-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .75rem; }
.ap-choice { position: relative; display: block; border: 1.5px solid #d2d2d7; border-radius: 16px; padding: .9rem 1rem; cursor: pointer; background: #fff; transition: border-color .12s, background-color .12s, box-shadow .12s; }
.ap-choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.ap-choice span { display: grid; gap: .25rem; }
.ap-choice small { line-height: 1.35; }
.ap-choice:hover { border-color: #a1a1a6; }
.ap-choice:has(input:checked) { border-color: var(--bs-primary, #0071e3); background: color-mix(in srgb, var(--bs-primary, #0071e3) 7%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bs-primary, #0071e3) 20%, transparent); }
.ap-choice:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--bs-primary, #0071e3) 55%, transparent); outline-offset: 2px; }
.ap-step-end { padding-left: 3rem; }
.ap-details { background: #f5f5f7; border-radius: 16px; }
.ap-details > summary { list-style: none; cursor: pointer; display: grid; gap: .15rem; padding: 1rem 3rem 1rem 1.25rem; position: relative; }
.ap-details > summary::-webkit-details-marker { display: none; }
.ap-details > summary span { font-weight: 600; }
.ap-details > summary small { font-size: .9rem; }
.ap-details > summary::after { content: "›"; position: absolute; right: 1.25rem; top: 50%; transform: translateY(-50%) rotate(90deg); font-size: 1.6rem; color: #6e6e73; transition: transform .2s; }
.ap-details[open] > summary::after { transform: translateY(-50%) rotate(-90deg); }
.ap-details-body { padding: 0 1.25rem 1.25rem; display: grid; gap: .9rem; }
.ap-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: .75rem; }
.ap-kpi { background: #fff; border-radius: 18px; padding: 1rem 1.1rem; display: grid; gap: .15rem; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04); }
.ap-kpi b { font-size: 1.75rem; font-weight: 650; letter-spacing: -.02em; line-height: 1.1; }
.ap-kpi span { font-size: .85rem; color: #424245; }
.ap-kpi small { font-size: .78rem; }
.ap-tabs { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; }
.ap-tabgroup { display: grid; gap: .35rem; }
.ap-tablabel { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #6e6e73; padding-left: .5rem; }
.ap-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; background: #e8e8ed; border-radius: 14px; padding: 3px; }
.ap-tab { padding: .4rem .95rem; border-radius: 11px; color: #1d1d1f; text-decoration: none; font-size: .92rem; font-weight: 500; }
.ap-tab:hover { background: rgba(255,255,255,.55); }
.ap-tab.active { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }
.ap table { font-size: .95rem; }
.ap fieldset { border-color: #e8e8ed !important; border-radius: 16px !important; }
@media (max-width: 575px) { .ap-stats { grid-template-columns: repeat(2, 1fr); } .ap-step { grid-template-columns: 1.75rem 1fr; gap: .75rem; } .ap-step-end { padding-left: 0; } .ap-section { padding: 1.25rem; } }
@media (prefers-reduced-motion: reduce) { .ap *, .ap-card { transition: none !important; } }

/* carte enveloppe de la page Tunnel : transparente, ses blocs sont déjà des cartes */
.ap > .card.ap-wrap, .ap > .card.shadow-sm.mb-3:has(> .card-body > .ap-head) { background: transparent; box-shadow: none !important; }
.ap > .card:has(> .card-body > .ap-head) > .card-body { padding: 0; gap: 2rem !important; }
body:has(.ap) { --bs-body-bg: #f5f5f7; }
.ap-usage { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.ap-use { background: #f5f5f7; border-radius: 16px; padding: 1rem 1.15rem; display: grid; gap: .6rem; }
.ap-use-top { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.ap-use-top b { font-size: 1.25rem; letter-spacing: -.01em; }
.ap-bar { height: 8px; border-radius: 980px; background: #e0e0e5; overflow: hidden; }
.ap-bar i { display: block; height: 100%; border-radius: 980px; background: var(--bs-primary, #0071e3); }
.ap-bar i.hot { background: #ff9f0a; }
.ap-head + .ap-tabs { margin-top: 1.25rem; }
.ap > .ap-tabs + * { margin-top: .25rem; }
