/* Prise en main (ob-*) et assistant budget (bw-*). Jetons de couleur repris de app.html. */

.ob-overlay, .bw-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 12, .72);
  backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ob-overlay { z-index: 945; }
.bw-overlay { z-index: 940; }
.ob-overlay.open, .bw-overlay.open { display: flex; }

.ob-card, .bw-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: min(92vh, 760px);
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
  overflow: hidden;
}
.bw-card { width: min(780px, 100%); height: min(92vh, 820px); max-height: none; }

/* ---------- Boutons ---------- */
.ob-btn, .bw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border-radius: 12px; border: 1px solid var(--border2);
  background: var(--bg3); color: var(--text);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
}
.ob-btn:hover, .bw-btn:hover { background: var(--bg4); }
.ob-btn:active, .bw-btn:active { transform: translateY(1px); }
.ob-btn:focus-visible, .bw-btn:focus-visible, .bw-input:focus-visible, .bw-select:focus-visible, .bw-chip:focus-visible, .bw-ghost:focus-visible, .bw-send:focus-visible {
  outline: 2px solid var(--accent2); outline-offset: 2px;
}
.ob-btn--primary, .bw-btn--primary { background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; }
.ob-btn--primary:hover, .bw-btn--primary:hover { filter: brightness(1.12); }
.ob-btn--quiet, .bw-btn--quiet { background: transparent; border-color: transparent; color: var(--text2); }
.ob-btn--quiet:hover, .bw-btn--quiet:hover { background: var(--bg3); color: var(--text); }
.bw-btn[disabled], .ob-btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- Prise en main ---------- */
.ob-head { padding: 18px 22px 0; }
.ob-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ob-brand { font-weight: 700; font-size: 15px; letter-spacing: -.2px; color: var(--text); }
.ob-brand span { color: var(--accent2); }
.ob-close {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: transparent;
  color: var(--text2); font-size: 20px; line-height: 1; cursor: pointer;
}
.ob-close:hover { background: var(--bg3); color: var(--text); }
.ob-progress { display: flex; gap: 6px; margin: 14px 0 12px; }
.ob-progress i { flex: 1; height: 5px; border-radius: 99px; background: var(--bg4); transition: background .2s; }
.ob-progress i.is-done { background: var(--green2); }
.ob-progress i.is-current { background: var(--accent); }
.ob-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.ob-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 99px;
  font-size: 12px; font-weight: 600; color: var(--text3); background: var(--bg3); border: 1px solid var(--border);
  cursor: pointer; font-family: inherit;
}
.ob-pill.is-current { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--k-7c6af7) 16%, transparent); }
.ob-pill.is-done { color: var(--green); }

.ob-body { padding: 22px 22px 8px; overflow-y: auto; }
.ob-icon {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 28px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--k-7c6af7) 28%, transparent), rgba(45, 212, 191, .16));
  border: 1px solid var(--border2); margin-bottom: 16px;
}
.ob-title { margin: 0 0 8px; font-size: 22px; line-height: 1.25; letter-spacing: -.3px; color: var(--text); font-weight: 700; }
.ob-lead { margin: 0 0 16px; font-size: 14.5px; line-height: 1.55; color: var(--text2); }
.ob-points { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 10px; }
.ob-points li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; color: var(--text2); }
.ob-points li::before {
  content: ""; flex: 0 0 18px; height: 18px; margin-top: 1px; border-radius: 50%;
  background: color-mix(in srgb, var(--k-7c6af7) 18%, transparent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23a89cf9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat;
}
.ob-status {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin: 0 0 14px; border-radius: 12px;
  background: rgba(16, 185, 129, .12); border: 1px solid rgba(16, 185, 129, .35); color: var(--green); font-size: 13.5px; font-weight: 600;
}
.ob-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 16px 22px 20px; }
.ob-quiet, .ob-main { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ob-main { justify-content: flex-end; }

/* ---------- Assistant budget ---------- */
.bw-head { flex: 0 0 auto; padding: 14px 18px 12px; border-bottom: 1px solid var(--border); background: var(--bg2); }
.bw-top { display: flex; align-items: center; gap: 12px; }
.bw-avatar {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; color: #fff;
  background: var(--accent-fill);
}
.bw-titles { min-width: 0; flex: 1; }
.bw-title { margin: 0; font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -.2px; }
.bw-sub { margin: 2px 0 0; font-size: 12px; color: var(--text3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bw-saved { color: var(--green); font-weight: 600; }
.bw-saved::before { content: "\2713\00a0"; }
.bw-x {
  flex: 0 0 auto; min-height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border2); background: var(--bg3);
  color: var(--text2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.bw-x:hover { color: var(--text); background: var(--bg4); }
.bw-progress { display: flex; gap: 5px; margin: 12px 0 8px; }
.bw-progress i { flex: 1; height: 5px; border-radius: 99px; background: var(--bg4); transition: background .2s; }
.bw-progress i.is-done { background: var(--green2); }
.bw-progress i.is-current { background: var(--accent); }
.bw-steps { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--text3); }
.bw-steps button {
  flex: 1; background: none; border: none; padding: 2px 0; font: inherit; font-size: 12px; color: var(--text3); cursor: pointer; text-align: center;
}
.bw-steps button.is-current { color: var(--text); font-weight: 700; }
.bw-steps button.is-done { color: var(--green); }
.bw-stepcount { font-size: 12px; color: var(--text2); font-weight: 600; margin-top: 2px; }

.bw-thread { flex: 1 1 auto; overflow-y: auto; padding: 18px 18px 8px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.bw-row { display: flex; gap: 10px; align-items: flex-end; max-width: 100%; }
.bw-row--user { justify-content: flex-end; }
.bw-mini { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-size: 13px; color: #fff; background: var(--accent-fill); }
.bw-bubble {
  max-width: min(560px, 88%); padding: 11px 14px; border-radius: 16px 16px 16px 5px;
  background: var(--bg3); border: 1px solid var(--border); color: var(--text); font-size: 14px; line-height: 1.5;
}
.bw-bubble strong { color: var(--text); }
.bw-bubble p { margin: 0 0 6px; }
.bw-bubble p:last-child { margin-bottom: 0; }
.bw-bubble--user { border-radius: 16px 16px 5px 16px; background: color-mix(in srgb, var(--k-7c6af7) 20%, transparent); border-color: color-mix(in srgb, var(--k-7c6af7) 40%, transparent); }
.bw-bubble--hint { color: var(--text2); background: transparent; border-style: dashed; font-size: 13px; }
.bw-edit { margin-left: 8px; background: none; border: none; color: var(--accent2); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 0; text-decoration: underline; }
.bw-undo { margin-top: 6px; background: none; border: none; color: var(--accent2); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 0; text-decoration: underline; }
.bw-typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.bw-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--text3); animation: bwdot 1s infinite ease-in-out; }
.bw-typing i:nth-child(2) { animation-delay: .15s; }
.bw-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bwdot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.bw-panel { background: var(--bg); border: 1px solid var(--border2); border-radius: 16px; padding: 14px; display: grid; gap: 12px; }
.bw-label { display: block; font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 5px; }
.bw-field { min-width: 0; }
.bw-input, .bw-select {
  width: 100%; min-height: 44px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border2);
  background: var(--bg3); color: var(--text); font: inherit; font-size: 15px; outline: none;
}
.bw-input:focus, .bw-select:focus { border-color: var(--accent); }
.bw-input--money { font-variant-numeric: tabular-nums; text-align: right; }
.bw-unit { display: flex; align-items: center; gap: 8px; }
.bw-unit > span { flex: 0 0 auto; color: var(--text3); font-size: 13px; }
.bw-person { border: 1px solid var(--border); border-radius: 14px; padding: 12px; background: var(--bg2); display: grid; gap: 10px; }
.bw-person h4 { margin: 0; font-size: 14px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.bw-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.bw-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bw-line { display: grid; grid-template-columns: minmax(0, 1fr) 110px 40px; gap: 8px; align-items: center; }
.bw-ghost {
  background: none; border: 1px dashed var(--border2); color: var(--text2); border-radius: 10px; min-height: 40px; padding: 8px 12px;
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.bw-ghost:hover { color: var(--text); border-color: var(--accent); }
.bw-icbtn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text3); font-size: 16px; cursor: pointer; }
.bw-icbtn:hover { color: var(--red); border-color: var(--red); }
.bw-total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--k-7c6af7) 12%, transparent); border: 1px solid color-mix(in srgb, var(--k-7c6af7) 30%, transparent); font-size: 13px; color: var(--text2); }
.bw-total strong { font-size: 17px; color: var(--text); font-variant-numeric: tabular-nums; }

.bw-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bw-choice {
  min-height: 48px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border2); background: var(--bg3); color: var(--text2);
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: left;
}
.bw-choice.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--k-7c6af7) 18%, transparent); color: var(--text); }
.bw-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bw-chip {
  min-height: 38px; padding: 7px 13px; border-radius: 99px; border: 1px solid var(--border2); background: var(--bg3); color: var(--text2);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.bw-chip.is-on { border-color: var(--green2); background: rgba(16, 185, 129, .14); color: var(--green); }
.bw-chip:hover { color: var(--text); }
.bw-group { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--text3); font-weight: 700; margin: 4px 0 -4px; }
.bw-charge { display: grid; grid-template-columns: minmax(0, 1fr) 104px 40px; gap: 8px; align-items: end; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg2); }
.bw-charge .bw-select { grid-column: 1 / 3; min-height: 38px; font-size: 13px; }
.bw-charge .bw-icbtn { align-self: end; }
.bw-charge.is-empty { border-color: color-mix(in srgb, var(--k-f59e0b) 55%, transparent); }
.bw-warn { font-size: 12px; color: var(--k-f59e0b); }

.bw-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bw-kpi { border: 1px solid var(--border2); border-radius: 14px; padding: 12px; background: var(--bg2); }
.bw-kpi span { display: block; font-size: 12px; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.bw-kpi strong { display: block; margin-top: 4px; font-size: 20px; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.bw-kpi--in strong { color: var(--green); }
.bw-kpi--out strong { color: var(--red); }
.bw-kpi--left strong { color: var(--accent2); }
.bw-kpi--neg strong { color: var(--red); }
.bw-sec { border: 1px solid var(--border); border-radius: 14px; background: var(--bg2); overflow: hidden; }
.bw-sec > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--bg3); font-size: 13px; font-weight: 700; color: var(--text); }
.bw-sec > header button { background: none; border: none; color: var(--accent2); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: underline; }
.bw-rec { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 10px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text2); }
.bw-rec:first-of-type { border-top: none; }
.bw-rec small { display: block; color: var(--text3); font-size: 12px; }
.bw-rec .bw-input { min-height: 38px; font-size: 14px; }
.bw-empty { padding: 12px; font-size: 13px; color: var(--text3); }

.bw-done { text-align: center; padding: 10px 6px 4px; display: grid; gap: 10px; justify-items: center; }
.bw-done .bw-big { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; background: rgba(16, 185, 129, .16); border: 1px solid rgba(16, 185, 129, .45); }
.bw-done h3 { margin: 0; font-size: 20px; color: var(--text); }
.bw-done p { margin: 0; color: var(--text2); font-size: 14px; max-width: 460px; }

.bw-dock { flex: 0 0 auto; padding: 8px 14px 6px; border-top: 1px solid var(--border); background: var(--bg2); }
.bw-composer { display: flex; align-items: flex-end; gap: 8px; }
.bw-composer textarea {
  flex: 1; min-height: 44px; max-height: 120px; resize: none; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--border2);
  background: var(--bg3); color: var(--text); font: inherit; font-size: 14px; line-height: 1.35; outline: none;
}
.bw-composer textarea:focus { border-color: var(--accent); }
.bw-send { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; border: none; background: var(--accent-fill); color: #fff; font-size: 18px; cursor: pointer; }
.bw-send[disabled] { opacity: .45; cursor: not-allowed; }
.bw-note { margin: 5px 2px 0; font-size: 12px; color: var(--text3); }
.bw-foot { flex: 0 0 auto; display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 14px 14px; background: var(--bg2); }
.bw-foot .bw-spacer { flex: 1; }

@media (max-width: 720px) {
  .ob-overlay, .bw-overlay { padding: 0; align-items: stretch; }
  .ob-card { width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; border: none; }
  .ob-body { flex: 1 1 auto; }
  .bw-card { width: 100%; height: 100dvh; border-radius: 0; border: none; }
  .ob-title { font-size: 20px; }
  .bw-grid2 { grid-template-columns: 1fr; }
  .bw-kpis { gap: 8px; }
  .bw-kpi { padding: 10px 8px; }
  .bw-kpi span { font-size: 12px; letter-spacing: .03em; }
  .bw-kpi strong { font-size: 15px; }
  .bw-steps button { font-size: 12px; }
  .bw-line { grid-template-columns: minmax(0, 1fr) 96px 40px; }
  .bw-charge { grid-template-columns: minmax(0, 1fr) 92px 40px; }
  .bw-rec { grid-template-columns: minmax(0, 1fr) 104px; }
  .bw-foot .bw-btn { flex: 1; }
  .ob-foot { flex-direction: column-reverse; align-items: stretch; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .ob-main { flex-direction: column-reverse; align-items: stretch; }
  .ob-main .ob-btn { width: 100%; }
  .ob-quiet { justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  .bw-thread { scroll-behavior: auto; }
  .bw-typing i { animation: none; opacity: .7; }
}

.bw-thread { position: relative; }
.bw-unit > .bw-input { flex: 1 1 auto; min-width: 0; }

.bw-thread > * { flex-shrink: 0; }

/* ======================================================================
   Prise en main, nouveau design (ob2-*), d'apres les maquettes Prise-en-main-bureau et Prise-en-main-mobile.
   Actif sauf si html.design-classic (la prise en main classique ob-* reste disponible).
   ====================================================================== */
.ob-card--v2 { width: min(1000px, 100%); max-height: min(94vh, 880px); border-radius: var(--r-lg); box-shadow: var(--shadow-window); }
.ob-card--v2 #onboarding-body { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.ob2 { display: flex; flex-direction: column; gap: 24px; padding: 20px 32px 28px; flex: 1 1 auto; }
.ob2-m { display: none; }
.ob2 .ob2-i { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ob2 h1, .ob2 h2, .ob2 p, .ob2 ol { margin: 0; }
.ob2 ol { padding: 0; list-style: none; }
.ob2-serif { font-family: 'Inter', system-ui, sans-serif; font-weight: 400; letter-spacing: -.01em; }
.ob2-kk { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent2); }
 .ob2-t3 { color: var(--text3); }  .ob2-act { color: var(--accent2); }
.ob2-sm { font-size: 14px; line-height: 1.5; } .ob2-xs { font-size: 13px; line-height: 1.45; } .ob2-b6 { font-weight: 600; }

.ob2-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ob2-greet { display: flex; flex-direction: column; gap: 12px; }
.ob2-greet h1 { font-size: 34px; line-height: 1.15; max-width: 640px; text-wrap: balance; }
.ob2-greet p { font-size: 17px; line-height: 1.55; color: var(--text2); max-width: 620px; }
.ob2-prog { display: flex; flex-direction: column; gap: 8px; }
.ob2-seg { display: flex; gap: 6px; }
.ob2-seg > i { flex: 1 1 0; height: 6px; border-radius: 3px; background: var(--bg4); }
.ob2-seg > i.d { background: var(--accent); }
.ob2-seg > i.n { background: var(--accent2); opacity: .55; }
.ob2-labels { display: flex; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text3); }
.ob2-labels span { flex: 1 1 0; }
.ob2-labels span:last-child { text-align: right; }
.ob2-labels .is-done { color: var(--green); } .ob2-labels .is-now { color: var(--accent2); }

.ob2-grid { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; flex: 1 1 auto; }
.ob2-card { flex: 999 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 20px; padding: 32px; border-radius: var(--r); background: var(--bg2); border: 1px solid var(--border2); box-shadow: var(--shadow-window); }
.ob2-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.ob2-bdg { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--bg4); color: var(--text2); }
.ob2-bdg--ac { background: var(--accent-tint); color: var(--accent2); }
.ob2-title { font-size: 34px; line-height: 1.15; color: var(--text); }
.ob2-lead { font-size: 15px; line-height: 1.55; color: var(--text2); }
.ob2-body { display: flex; flex-direction: column; gap: 16px; }
.ob2-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.ob2-note { font-size: 13px; color: var(--text3); }

.ob2-aside { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ob2-steps { border-top: 1px solid var(--border); }
.ob2-stp { display: flex; gap: 14px; align-items: flex-start; padding: 16px 0; border-bottom: 1px solid var(--border); }
.ob2-nb { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex: 0 0 auto; border: 1.5px solid var(--border2); color: var(--text2); }
.ob2-stp.is-ok .ob2-nb { background: var(--green); border-color: transparent; color: var(--bg); }
.ob2-stp.is-now .ob2-nb { border-color: var(--accent); color: var(--accent2); }
.ob2-stp .ob2-col { display: flex; flex-direction: column; flex: 1 1 0; min-width: 0; }
.ob2-stp-btn { all: unset; display: flex; gap: 14px; align-items: flex-start; flex: 1 1 auto; cursor: pointer; }
.ob2-stp-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.ob2-priv { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--text3); }
.ob2-design { background: none; border: none; padding: 0; margin-top: 14px; color: var(--text3); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; text-align: left; }
.ob2-design:hover { color: var(--text); }

.ob2-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border: 1px solid var(--border2); border-radius: var(--r-sm); background: var(--bg3); color: var(--text); font: inherit; font-weight: 600; font-size: 15px; line-height: 1.2; cursor: pointer; white-space: nowrap; text-decoration: none; }
.ob2-btn:hover { background: var(--bg4); }
.ob2-btn--pri { background: var(--accent-fill); border-color: transparent; color: #fff; }
.ob2-btn--pri:hover { background: var(--accent-fill); filter: brightness(1.12); }
.ob2-btn--gh { background: transparent; border-color: transparent; color: var(--text2); }
.ob2-btn--gh:hover { background: var(--bg3); color: var(--text); }
.ob2-btn--out { background: transparent; }
.ob2-btn--lg { min-height: 52px; padding: 0 28px; font-size: 16px; }
.ob2-btn[disabled] { opacity: .45; cursor: not-allowed; }
.ob2-icb { width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 auto; }
.ob2-icb:hover { background: var(--bg3); color: var(--text); }
.ob2 :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.ob2-choices { display: flex; flex-direction: column; gap: 12px; }
.ob2-choice { display: flex; align-items: flex-start; gap: 14px; width: 100%; padding: 16px; border: 1px solid var(--border2); border-radius: var(--r); background: var(--bg2); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ob2-choice.is-on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.ob2-rdo { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border2); flex: 0 0 auto; margin-top: 1px; display: flex; align-items: center; justify-content: center; }
.ob2-choice.is-on .ob2-rdo { border-color: var(--accent); }
.ob2-choice.is-on .ob2-rdo::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.ob2-col { display: flex; flex-direction: column; gap: 4px; flex: 1 1 0; min-width: 0; }

.ob2-fld { display: flex; flex-direction: column; gap: 6px; }
.ob2-lbl { font-weight: 600; font-size: 14px; color: var(--text); }
.ob2-hint { font-size: 13px; color: var(--text3); }
.ob2-inp { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 14px; background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--r-sm); }
.ob2-inp:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.ob2-inp input { flex: 1 1 auto; min-width: 0; border: 0; outline: 0 !important; background: transparent; color: var(--text); font: inherit; font-size: 16px; }
.ob2-inp input::placeholder { color: var(--text3); }
.ob2-inp--big { min-height: 64px; }
.ob2-inp--big input { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ob2-inp .ob2-u { color: var(--text3); font-weight: 500; font-size: 20px; }
.ob2-err { font-size: 13px; color: var(--red); }
.ob2-ok { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r); background: rgba(52, 211, 153, .14); }
html.theme-light .ob2-ok { background: rgba(21, 128, 61, .10); }
.ob2-ok .ob2-row { display: flex; align-items: center; gap: 8px; color: var(--green); font-weight: 600; }
.ob2-mono { font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace; font-size: 13px; padding: 10px 12px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--border); color: var(--text2); word-break: break-all; }
.ob2-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.ob2-sg { display: flex; padding: 3px; gap: 2px; border-radius: var(--r-sm); background: var(--bg3); border: 1px solid var(--border); }
.ob2-sg button { flex: 1 1 0; min-height: 44px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--text2); font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; }
.ob2-sg button.is-on { background: var(--bg2); color: var(--text); box-shadow: 0 0 0 1px var(--border2); }
.ob2-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--border2); border-radius: 999px; background: transparent; color: var(--text2); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.ob2-chip.is-on { background: var(--accent-tint); border-color: var(--accent); color: var(--accent2); }
.ob2-chip .ob2-i { width: 18px; height: 18px; }
.ob2-av { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: #0f0f12; flex: 0 0 auto; background: var(--bg4); }

@media (max-width: 720px) {
  .ob-card--v2 { width: 100%; height: 100dvh; max-height: none; border-radius: 0; box-shadow: none; }
  .ob2 { gap: 20px; padding: 0 0 max(24px, env(safe-area-inset-bottom)); }
  .ob2-d { display: none !important; }
  .ob2-m { display: flex; }
  .ob2-bar { align-items: center; gap: 4px; min-height: 56px; padding: 6px 8px; }
  .ob2-bar .ob2-count { flex: 1 1 0; text-align: center; font-size: 13px; font-weight: 600; color: var(--text3); }
  .ob2-prog { padding: 0 20px; }
  .ob2-grid { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 0; align-items: stretch; flex: 1 1 auto; }
  .ob2-card { flex: 1 1 auto; border: 0; box-shadow: none; background: transparent; padding: 0 20px; border-radius: 0; gap: 20px; }
  .ob2-title { font-size: 26px; line-height: 1.2; }
  .ob2-cta { flex-direction: column; align-items: stretch; margin-top: auto; padding-top: 8px; }
  .ob2-cta .ob2-btn { width: 100%; }
  .ob2-note { text-align: center; }
}
@media (prefers-reduced-motion: no-preference) {
  .ob2-card.is-enter { animation: ob2in .24s ease-out; }
  @keyframes ob2in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* Interrupteur d'apparence (Reglages) */
.ui-design-switch { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-sm); background: var(--bg3); border: 1px solid var(--border); }
.ui-design-switch button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; color: var(--text2); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.ui-design-switch button.is-on { background: var(--bg2); color: var(--text); box-shadow: 0 0 0 1px var(--border2); }
/* L'ancre #main * fixe la police : on la rend aux titres serif et au texte technique de la prise en main */
#main .ob2-serif { font-family: 'Inter', system-ui, sans-serif; }
#main .ob2-mono { font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace; }

/* Les etiquettes globales de l'application (majuscules, 12 px) ne s'appliquent pas aux champs de la prise en main */
.ob2 label.ob2-fld { display: flex; margin: 0; font-size: 14px; font-weight: 400; text-transform: none; letter-spacing: normal; color: var(--text); }

/* Rentes et primes de l'assistant budget */
.bw-subsec { border-top: 1px dashed var(--border2); padding-top: 12px; display: grid; gap: 10px; }
.bw-subtitle { margin: 0; font-size: 14px; font-weight: 700; color: var(--text); }
.bw-hint { display: block; font-size: 13px; line-height: 1.45; color: var(--text3); margin: 0; }
.bw-linehead { display: grid; grid-template-columns: minmax(0, 1fr) 110px 40px; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text3); }
.bw-line--2 { grid-template-columns: minmax(0, 1fr) 40px; }
.bw-prime { border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg2); padding: 12px; display: grid; gap: 10px; }
.bw-eq { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text2); }
.bw-eq strong { color: var(--text); font-variant-numeric: tabular-nums; }
.bw-eq--sum { padding: 8px 10px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--k-7c6af7) 12%, transparent); }
.bw-ask { border: 1px solid var(--accent); border-radius: var(--r-sm); padding: 12px; display: grid; gap: 10px; background: var(--accent-tint); }
.bw-ask p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text); }
.bw-choice small { display: block; margin-top: 3px; font-size: 12px; font-weight: 400; color: var(--text3); line-height: 1.35; }
.bw-amt { font-variant-numeric: tabular-nums; color: var(--text); text-align: right; }
@media (max-width: 720px) {
  .bw-linehead { grid-template-columns: minmax(0, 1fr) 96px 40px; }
}

/* Les etiquettes globales de l'application sont en majuscules : plus lisible en minuscules dans l'assistant */
.bw-overlay label, .bw-overlay .bw-label { text-transform: none; letter-spacing: normal; font-size: 13px; color: var(--text2); }

/* Rassurance confidentialite */
.trust-line { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; line-height: 1.45; color: var(--text2); }
.trust-line a { color: var(--accent2); text-decoration: underline; }
.trust-line-wrap { margin: 8px 0 0; }
.ob2-trust { margin: 4px 0 0; }
.trust-panel p { margin: 0 0 10px; font-size: 14px; line-height: 1.5; color: var(--text2); }
.trust-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 12px; }
.trust-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; color: var(--text2); }
.trust-list strong { color: var(--text); font-size: 14px; }
.trust-ico { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent2); font-size: 16px; }
.trust-ai { padding: 10px 12px; border-radius: var(--r-sm); background: var(--bg3); border: 1px solid var(--border); }
.trust-small { font-size: 13px !important; color: var(--text3) !important; }
.trust-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

/* Points d'information sur les mots difficiles */
.gl-last { white-space: nowrap; }
.gl-btn { display: inline-grid; place-items: center; width: 20px; height: 20px; margin: 0 2px 0 4px; padding: 0; border: 1px solid var(--accent); border-radius: 50%; background: var(--accent-tint); color: var(--accent2); font: italic 700 12px/1 Georgia, 'Times New Roman', serif; cursor: pointer; vertical-align: 1px; text-transform: none; letter-spacing: 0; }
.gl-btn:hover, .gl-btn[aria-expanded="true"] { background: var(--accent); color: var(--bg); }
.gl-btn:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
@media (pointer: coarse) { .gl-btn { width: 26px; height: 26px; font-size: 14px; } }
html.lvl-expert .gl-btn { display: none; }
.gl-pop { position: fixed; z-index: 10050; max-width: calc(100vw - 24px); padding: 14px; border: 1px solid var(--border2); border-radius: var(--r); background: var(--bg2); color: var(--text2); box-shadow: var(--shadow-lg, 0 12px 32px rgba(0, 0, 0, .35)); font-size: 14px; line-height: 1.5; text-transform: none; letter-spacing: normal; font-weight: 400; }
.gl-pop[hidden] { display: none; }
.gl-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.gl-pop-head strong { color: var(--text); font-size: 15px; }
.gl-x { width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--text2); font-size: 20px; line-height: 1; cursor: pointer; }
.gl-x:hover { background: var(--bg3); }
.gl-pop p { margin: 0 0 10px; }
.gl-pop-actions { display: flex; gap: 8px; }
.gl-listen { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--accent); border-radius: 999px; background: var(--accent-tint); color: var(--accent2); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.gl-listen.is-playing { background: var(--accent); color: var(--bg); }

/* Lecture a voix haute */
.vo-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; margin: 0 0 0 8px; padding: 0; border: 1px solid var(--border2); border-radius: 50%; background: transparent; color: var(--text2); cursor: pointer; vertical-align: middle; float: right; }
.vo-btn .ico { font-size: 14px; }
.vo-btn:hover { background: var(--bg3); color: var(--text); }
.vo-btn.is-playing { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.vo-btn:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
.ob2-lead, .ob-lead { overflow: hidden; }
html.lvl-guide .vo-btn { width: 40px; height: 40px; }
html.lvl-guide .vo-btn .ico { font-size: 18px; }
html.lvl-guide .bw-bubble { font-size: 16px; line-height: 1.6; }
html.lvl-guide .bw-bubble p { margin-bottom: 8px; }
@media (prefers-reduced-motion: no-preference) { .vo-btn.is-playing { animation: vo-pulse 1.4s ease-in-out infinite; } }
@keyframes vo-pulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 25%, transparent); } }

/* Ecran d'accueil : langue et accompagnement */
.ob2-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; color: var(--text2); text-transform: none; letter-spacing: normal; cursor: pointer; }
.ob2-check input { width: 22px; height: 22px; accent-color: var(--accent); flex: 0 0 auto; }
.ob2-welcome .ob2-chip small { font-size: 11px; color: var(--text3); }
.ob2-chip:disabled { opacity: .55; cursor: not-allowed; }

/* Reglages : profil d'accompagnement */
.pf-grid { display: grid; gap: 12px; }
.pf-row { display: grid; gap: 4px; }
.pf-row label { font-size: 13px; font-weight: 600; color: var(--text2); }
.pf-row select { min-height: 44px; }
.pf-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; color: var(--text2); }
.pf-check input { width: 22px; height: 22px; accent-color: var(--accent); }

/* Langues ecrites de droite a gauche (arabe) : les fenetres d'assistance suivent le sens du texte */
html.lang-rtl .bw-card, html.lang-rtl .ob-card, html.lang-rtl .gl-pop { direction: rtl; text-align: start; }
html.lang-rtl .vo-btn { float: left; margin: 0 8px 0 0; }
html.lang-rtl .bw-bubble--user { border-radius: 16px 16px 16px 5px; }
html.lang-rtl .ob2-i[data-flip] { transform: scaleX(-1); }

/* Deux enveloppes : charges du groupe (partagées) et charges personnelles */
.bw-env { border: 1px solid var(--accent); border-radius: var(--r-sm); background: var(--accent-tint); padding: 12px; display: grid; gap: 10px; }
.bw-env-title { font-weight: 700; font-size: 14px; color: var(--text); }
.bw-env-text { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text2); }
.bw-env-text strong { color: var(--text); }
.bw-env-sum { font-weight: 600; color: var(--text); }

/* Charge personnelle avancée par une autre personne : qui paie et comment la compenser */
.bw-sub-pay { display: grid; gap: 8px; }
.bw-charge .bw-sub-pay { grid-column: 1 / -1; display: grid; gap: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.bw-sub-pay .bw-env-text { font-size: 12.5px; }

/* Récapitulatif : charges communes et individuelles séparées, avec totaux */
.bw-rec--total { display: flex; justify-content: space-between; align-items: baseline; background: var(--bg3); font-weight: 700; color: var(--text); }
.bw-group-row { padding: 8px 12px 4px; border-top: 1px solid var(--border); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent2); }
.bw-linkbtn { display: inline-block; margin-top: 2px; padding: 0; background: none; border: none; color: var(--accent2); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: underline; }
.bw-split-line { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 2px; font-size: 13px; color: var(--text2); }
.bw-split-line strong { color: var(--text); font-variant-numeric: tabular-nums; }

/* Chiffres cliquables et fenêtres de détail déplaçables (tableau de bord, Réglages, assistant) */
.vis-fig { margin: 0; padding: 2px 0; border: 0; border-radius: 3px; background: none; color: inherit; font: inherit; cursor: pointer; text-decoration: underline dotted; text-decoration-color: var(--text3); text-underline-offset: 3px; }
.vis-fig:hover, .vis-fig:focus-visible { color: var(--accent2); text-decoration-color: var(--accent2); }
.dw { position: fixed; display: flex; flex-direction: column; max-width: calc(100vw - 16px); max-height: min(80vh, 640px); border: 1px solid var(--border2); border-radius: var(--r); background: var(--bg2); color: var(--text2); box-shadow: 0 18px 48px rgba(0, 0, 0, .5); font-size: 13px; line-height: 1.5; outline: none; text-transform: none; letter-spacing: normal; font-weight: 400; }
.dw-bar { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--border); border-radius: var(--r) var(--r) 0 0; background: var(--bg3); color: var(--text); font-weight: 700; cursor: grab; touch-action: none; user-select: none; }
.dw-bar:active { cursor: grabbing; }
.dw-title { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.dw-sep { margin: 0 4px; color: var(--text3); }
.dw-x { min-width: 40px; min-height: 40px; border: 0; border-radius: 8px; background: transparent; color: var(--text2); font: inherit; cursor: pointer; }
.dw-x:hover { background: var(--bg4); color: var(--text); }
.dw-body { padding: 6px 14px 14px; overflow: auto; }
.dw-r { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-top: 1px dashed var(--border); }
.dw-r:first-child { border-top: 0; }
.dw-g { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 12px; align-items: baseline; padding: 7px 0; border-top: 1px dashed var(--border); }
.dw-h { border-top: 0; font-size: 11px; font-weight: 700; color: var(--text3); }
.dw-h > span:nth-child(n+2) { text-align: right; }
.dw-l { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.dw-l small { display: block; color: var(--text3); font-size: 11px; }
.dw-v { font-family: monospace; text-align: right; white-space: nowrap; }
.dw-total { border-top: 1px solid var(--border2); color: var(--text); font-weight: 700; }
.dw-strong { color: var(--text); font-weight: 700; }
.dw-s { display: inline-block; width: 1em; text-align: center; color: var(--text3); }
.dw-note { margin: 8px 0 0; color: var(--text3); font-size: 12px; line-height: 1.5; }

/* Design bancaire : même police partout, les grands titres passent en Inter semi-gras */
.ob2-serif, .ob2-title, .ob2-greet h1, .ob-title { font-weight: 600; letter-spacing: -.025em; }
