/* Onboarding, budget builder, walkthrough */

/* ---------- onboarding ---------- */
.ob { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.ob-top { display: flex; align-items: center; gap: 24px; height: 64px; padding: 0 28px; border-bottom: 1px solid var(--line); background: var(--surface); }
.ob-top > .row { width: 160px; }
.ob-top > .btn { margin-left: auto; }
.ob-steps { list-style: none; margin: 0 auto; padding: 0; display: flex; align-items: center; gap: 10px; }
.ob-steps li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.ob-steps li.on { color: var(--ink); }
.ob-steps li.done { color: var(--brand-2); }
.ob-steps .ob-step-line { width: 28px; height: 1px; background: var(--line-2); }
.ob-step-dot { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; border: 1px solid var(--line-2); background: var(--surface); }
.ob-steps li.on .ob-step-dot { background: var(--ink); border-color: var(--ink); color: #fff; }
.ob-steps li.done .ob-step-dot { background: var(--brand-tint); border-color: var(--brand-tint-2); color: var(--brand); }
.ob-main { flex: 1; display: flex; justify-content: center; padding: 56px 24px 80px; }
.ob-card { width: min(640px, 100%); animation: msgIn .25s ease-out; }
.ob-head { margin-bottom: 28px; }
.ob-head h1 { font-size: 28px; letter-spacing: -0.025em; }
.ob-head p { margin-top: 8px; font-size: 14.5px; }
.ob-form { display: flex; flex-direction: column; gap: 16px; }
.ob-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ob-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.ob-sources { display: flex; flex-direction: column; gap: 22px; }
.ob-src-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ob-src {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); transition: border-color .12s, box-shadow .12s, background .12s; min-height: 56px; min-width: 0;
}
.ob-src:hover { border-color: var(--line-2); box-shadow: var(--shadow-1); }
.ob-src.on { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(30, 112, 72, .1); }
.ob-check { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line-2); display: grid; place-items: center; flex: none; color: #fff; }
.ob-src.on .ob-check { background: var(--brand); border-color: var(--brand); }
.ob-src-name { display: block; font-weight: 500; font-size: 13.5px; }
.ob-src-blurb { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; line-height: 1.4; }
.ob-bank { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); padding: 28px; box-shadow: var(--shadow-1); }
.ob-bank-brand { display: flex; align-items: center; gap: 12px; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.ob-hbank { width: 40px; height: 40px; border-radius: 11px; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; }
.ob-hbank.sm { width: 32px; height: 32px; border-radius: 9px; }
.ob-consent { list-style: none; margin: 4px 0 0; padding: 14px; border-radius: 11px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.ob-consent li { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; color: var(--ink-2); }
.ob-consent .ico { flex: none; margin-top: 2px; color: var(--brand-2); }
.ob-success { width: 40px; height: 40px; border-radius: 50%; background: var(--green-tint); color: var(--green); display: grid; place-items: center; margin-bottom: 14px; }
.ob-accounts { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.ob-acct { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ob-acct.total { background: var(--surface-2); border-bottom: 0; }
@media (max-width: 900px) { .ob-steps li:not(.on):not(.ob-step-line) span:last-child { display: none; } .ob-src-grid, .ob-grid { grid-template-columns: 1fr; } }

/* ---------- builder / walkthrough layout ---------- */
.bld { display: grid; grid-template-columns: 420px 1fr; height: 100vh; overflow: hidden; }
.bld.dragging .bld-chat .composer-box { border-color: var(--brand-2); background: var(--brand-tint); }
.bld.dragging::after { content: 'Drop to upload'; position: fixed; inset: 12px; border: 2px dashed var(--brand-2); border-radius: 18px; background: rgba(233, 242, 236, .7); display: grid; place-items: center; font-weight: 600; color: var(--brand); z-index: 70; pointer-events: none; }
.bld-chat { border-right: 1px solid var(--line); }
.bld-chat .msg .bubble { max-width: 100%; }
.bld-main { overflow: auto; background: var(--bg); scrollbar-width: thin; }
.bld-inner { max-width: 1040px; margin: 0 auto; padding: 28px 32px 80px; display: flex; flex-direction: column; gap: 16px; }
.bld-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 4px; }
.bld-head h1 { font-size: 24px; margin-top: 4px; }
.bld-progress { display: flex; align-items: center; gap: 16px; padding: 16px 20px; }
.bld-check { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; }
.bld-check span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.bld-check span i { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--line-2); display: inline-block; }
.bld-check span.active { color: var(--ink); font-weight: 500; }
.bld-check span.active i { border-color: var(--brand-2); box-shadow: inset 0 0 0 2.5px var(--surface), inset 0 0 0 6px var(--brand-2); }
.bld-check span.done { color: var(--brand-2); }
.bld-qs .card-head { padding-bottom: 0; }
.bld-table { overflow: hidden; }
.bld-table .card-head { padding-bottom: 12px; }
.bb-wrap { overflow-x: auto; }

/* chat widgets */
.bc-choices { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.bc-choice { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface); text-align: left; transition: border-color .12s, background .12s; }
.bc-choice:hover:not(:disabled) { border-color: var(--brand-2); background: var(--brand-tint); }
.bc-choice:disabled { opacity: .5; cursor: default; }
.bc-choice .t { display: block; font-weight: 500; font-size: 13.5px; }
.bc-choice .h { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.bc-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px; border-radius: 12px; border: 1.5px dashed var(--line-2); background: var(--surface-2); color: var(--ink-2); font-size: 13px; margin-top: 4px; width: 100%; }
.bc-drop:hover:not(:disabled) { border-color: var(--brand-2); background: var(--brand-tint); }
.bc-drop:disabled { opacity: .5; }

.bf { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); padding: 12px; margin-top: 4px; display: flex; flex-direction: column; gap: 8px; }
.bf.locked { opacity: .55; pointer-events: none; }
.bf .input.sm, .bf .select.sm { background: var(--surface); }
.bf-rows { display: flex; flex-direction: column; gap: 6px; }
.bf-row, .bf-cols { display: grid; grid-template-columns: 18px 1fr 104px 108px; gap: 6px; align-items: center; }
.bf-row.op { grid-template-columns: 1fr 120px; }
body.chat-wide .bf-row, body.chat-wide .bf-cols { grid-template-columns: 18px minmax(0, 2fr) minmax(130px, 1fr) minmax(160px, 1fr); gap: 8px; }
body.chat-wide .bf-row.op { grid-template-columns: minmax(0, 2fr) minmax(140px, 1fr); }
.bf-cols { padding: 0 2px; }
.bf-money { position: relative; display: block; }
.bf-money > span { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12.5px; pointer-events: none; }
.bf-money .input { padding-left: 18px; }
.bf-pct { display: flex; align-items: center; gap: 4px; }
.bf-pct > span { font-size: 12px; color: var(--muted); }
.bf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bf-grid.three { grid-template-columns: repeat(3, 1fr); }
.bf-grid .field > span, .bf .field > span { font-size: 11.5px; }
.bf-proj { display: grid; grid-template-columns: 1fr 104px 28px; gap: 6px; padding: 8px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); }
.bf-proj [name=name] { grid-area: 1 / 1; }
.bf-proj .bf-money { grid-area: 1 / 2; }
.bf-proj [data-rmproj] { grid-area: 1 / 3; }
.bf-proj [name=start] { grid-area: 2 / 1; }
.bf-proj .bf-pct { grid-area: 2 / 2 / 3 / 4; }
.bf-proj [name=support] { grid-area: 3 / 1 / 4 / 4; }
.bf-months { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.bf-month { position: relative; cursor: pointer; }
.bf-month input { position: absolute; opacity: 0; }
.bf-month span { display: block; text-align: center; padding: 5px 0; border-radius: 7px; border: 1px solid var(--line-2); background: var(--surface); font-size: 12px; }
.bf-month input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.bf-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 2px; }

/* questions */
.bq { display: flex; flex-direction: column; gap: 10px; }
.bq.inline { margin-top: 4px; }
.bq-item { padding: 12px 14px; border-radius: 12px; border: 1px solid #F0DDB5; background: #FFFBF3; }
.bq-item.answered { border-color: var(--line); background: var(--surface-2); }
.bq-text { font-size: 13.5px; }
.bq-text p { margin: 0; }
.bq .opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.bq-item.answered .opt:not(.on) { opacity: .6; }

/* budget table */
.bb-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.bb-table th { font-size: 11.5px; font-weight: 500; color: var(--muted); text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.bb-table th.r, .bb-table td.r { text-align: right; }
.bb-table th.cur { color: var(--ink); }
.bb-table td { padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.bb-table td.cur { font-weight: 500; }
.bb-table th:first-child, .bb-table td:first-child { padding-left: 20px; }
.bb-table th:last-child, .bb-table td:last-child { padding-right: 20px; }
.bb-sechead td { background: var(--surface-2); padding-top: 10px; padding-bottom: 10px; }
.bb-name { display: flex; align-items: center; gap: 4px; max-width: 340px; }
.bb-row.d1 .bb-name { padding-left: 22px; color: var(--ink-2); }
.bb-row.d2 .bb-name { padding-left: 44px; color: var(--ink-2); }
.bb-tog, .bb-tog-sp { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 4px; color: var(--muted); flex: none; }
.bb-tog:hover { background: var(--sunken); color: var(--ink); }
.bb-tier { width: 96px; }
.bb-spark { width: 120px; }
.bb-bars { width: 96px; height: 22px; display: block; }
.bb-spark.rev .bb-bars rect { fill: var(--lc-available); }
.bb-spark.exp .bb-bars rect { fill: var(--lc-committed); }
.bb-row { transition: opacity .2s, background .2s; }
.bb-row.dim { opacity: .42; }
.bb-row.focus td { background: var(--brand-tint); }
.bb-row.focus td:first-child { box-shadow: inset 3px 0 0 var(--brand-2); }
.bb-row.new { animation: rowIn .6s ease-out; }
@keyframes rowIn { from { opacity: 0; background: rgba(91, 183, 73, .18); transform: translateY(-3px); } }
.bb-row.ref-tagged td { background: rgba(213, 232, 219, .6); }
.bb-net td { font-weight: 600; border-bottom: 0; padding-top: 12px; padding-bottom: 14px; }
.bb-skel td { border-bottom-color: transparent; }
.sk { display: inline-block; height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--sunken), #F7F7F4, var(--sunken)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* walkthrough */
.wt .bb-row { cursor: pointer; }
.wt .bb-row:hover td { background: var(--surface-2); }
.wt .bb-row.focus:hover td { background: var(--brand-tint); }
.wt-progress { height: 2px; background: var(--sunken); flex: none; }
.wt-progress i { display: block; height: 100%; background: var(--brand-2); transition: width .3s ease; }
.wt-step { display: flex; flex-direction: column; gap: 10px; }
.wt-step.past { cursor: pointer; }
.wt-step.past .wt-step-title { color: var(--muted); }
.wt-step.past:hover .wt-step-title { color: var(--ink); }
.wt-step-title { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; }
.wt-n { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 10.5px; background: var(--ink); color: #fff; flex: none; }
.wt-step.past .wt-n { background: var(--brand-tint); color: var(--brand); }
.wt-step.cur .msg .bubble { font-size: 14px; }
.wt-controls { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); flex: none; }
.bld-chat .composer { padding-top: 6px; }

@media (max-width: 1100px) { .bld { grid-template-columns: 360px 1fr; } }
