:root {
  --bg: #F5F6F8;
  --card: #FFFFFF;
  --ink: #12141A;
  --muted: #5A6070;
  --faint: #9AA0AE;
  --line: #E3E6EC;
  --accent: #2B50D8;
  --accent-soft: #E8EDFC;
  --green: #1E9E5A;
  --green-soft: #E2F5EA;
  --yellow: #C98A00;
  --yellow-soft: #FDF1DE;
  --red: #C2361F;
  --red-soft: #FDECE8;
  --radius: 20px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 16px/1.5 "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }

/* ---------- shell ---------- */
.top { position: sticky; top: 0; z-index: 5; background: rgba(245, 246, 248, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1180px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 28px; }
.logo { height: 30px; display: block; }
.nav { display: flex; gap: 6px; flex: 1; }
.nav a { padding: 8px 14px; border-radius: 12px; color: var(--muted); font-weight: 600; font-size: 15px; white-space: nowrap; }
.nav a:hover { background: #ECEEF2; text-decoration: none; }
.nav a.on { background: var(--ink); color: #fff; }
.who { position: relative; }
.who-btn { border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 8px 14px; font-weight: 600; font-size: 14px; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(18, 20, 26, .12); min-width: 230px; padding: 6px; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.menu button:hover { background: var(--bg); }
.menu .danger { color: var(--red); }
main { max-width: 1180px; margin: 0 auto; padding: 28px 24px 64px; }
h1 { font-size: 34px; line-height: 1.1; letter-spacing: -0.8px; margin: 0; font-weight: 800; }
h2 { font-size: 18px; margin: 0 0 14px; font-weight: 700; letter-spacing: -0.2px; }
.sub { color: var(--muted); margin: 6px 0 0; }

/* ---------- pieces ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: 0 1px 2px rgba(18, 20, 26, .04); }
.btn { border: 0; border-radius: 14px; padding: 12px 18px; font-weight: 700; font-size: 15px; background: var(--ink); color: #fff; display: inline-flex; align-items: center; gap: 8px; justify-content: center; }
.btn:hover { opacity: .92; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.light { background: #ECEEF2; color: var(--ink); }
.btn.blue { background: var(--accent); }
.btn.small { padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: 14px; color: var(--muted); }
.input { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; font-size: 16px; width: 100%; }
.input:focus { outline: none; border-color: var(--accent); }
.error { background: var(--red-soft); color: var(--red); border-radius: 12px; padding: 10px 14px; font-weight: 600; font-size: 14px; margin: 12px 0; }
.note { color: var(--muted); font-size: 14px; }
.pill { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.yellow { background: var(--yellow-soft); color: var(--yellow); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.none { background: #ECEEF2; color: var(--muted); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid #D5D9E1; border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center { display: grid; place-items: center; padding: 60px 0; }

/* ---------- sign in ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side { background: var(--ink); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h1 { font-size: 48px; letter-spacing: -1.4px; max-width: 480px; }
.auth-side p { color: #C9CEDA; font-size: 18px; max-width: 460px; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-form .card { width: 100%; max-width: 420px; padding: 32px; }
.switch { margin-top: 16px; text-align: center; font-size: 15px; }
.switch button { border: 0; background: none; color: var(--accent); font-weight: 700; padding: 0; }

/* ---------- dashboard ---------- */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.months { display: flex; align-items: center; gap: 10px; }
.months button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--card); font-size: 20px; font-weight: 700; display: grid; place-items: center; }
.months button:disabled { opacity: .35; cursor: default; }
.months span { font-weight: 700; font-size: 17px; min-width: 150px; text-align: center; }
.headline { border-radius: var(--radius); padding: 18px 22px; font-weight: 700; font-size: 19px; letter-spacing: -0.2px; display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.headline.bad { background: var(--red-soft); color: #8E2A17; }
.headline.warn { background: var(--yellow-soft); color: #7A5400; }
.headline.good { background: var(--green-soft); color: #146B3D; }
.headline.info { background: var(--accent-soft); color: #1E3A9E; }
.headline .dot { width: 12px; height: 12px; border-radius: 50%; background: currentColor; flex: none; }
.grid { display: grid; grid-template-columns: 1fr 1.25fr 1.15fr; gap: 20px; }
.ring-wrap { display: grid; place-items: center; position: relative; }
.ring-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.ring-center b { display: block; font-size: 26px; letter-spacing: -0.6px; font-weight: 800; }
.ring-center small { color: var(--muted); font-size: 13px; font-weight: 600; }
.stats { display: flex; justify-content: space-between; margin-top: 16px; gap: 10px; }
.stats div { flex: 1; background: var(--bg); border-radius: 14px; padding: 10px 12px; }
.stats small { display: block; color: var(--muted); font-weight: 600; font-size: 12px; }
.stats b { font-size: 17px; }
.slice { cursor: pointer; transition: opacity .15s; }
.slice:hover { opacity: .8; }
.legend { display: grid; gap: 2px; margin-top: 14px; }
.legend button { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 7px 8px; border-radius: 10px; text-align: left; width: 100%; }
.legend button:hover { background: var(--bg); }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend .nm { flex: 1; font-weight: 600; font-size: 14px; }
.legend .am { font-weight: 700; font-size: 14px; }
.warn-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 8px; border-radius: 12px; cursor: pointer; }
.warn-row:hover { background: var(--bg); }
.warn-row .nm { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.warn-row .st { width: 10px; height: 10px; border-radius: 50%; }
.warn-row .vs { color: var(--muted); font-size: 13px; grid-column: 1 / -1; }
.bar { height: 6px; border-radius: 3px; background: #EEF0F4; grid-column: 1 / -1; overflow: hidden; position: relative; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }
.bar u { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink); opacity: .45; }
.flow { margin-top: 20px; }
.flow svg { width: 100%; height: auto; display: block; }
.flow text { font-family: inherit; font-size: 13px; font-weight: 600; fill: var(--ink); }
.flow text.m { fill: var(--muted); font-weight: 500; }
.empty { text-align: center; padding: 56px 24px; }
.empty h2 { font-size: 24px; margin-bottom: 8px; }
.empty p { color: var(--muted); max-width: 520px; margin: 0 auto 20px; }

/* ---------- personal / business ---------- */
.seg-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: -6px 0 18px; }
.seg { display: inline-flex; background: #E4E7ED; border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: none; padding: 7px 16px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(18, 20, 26, .12); }
.chip { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; color: var(--muted); }
.chip.business { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip:hover { border-color: var(--ink); }
.buy .tools { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.ask { grid-column: 1 / -1; background: var(--accent-soft); border-radius: 12px; padding: 10px 12px; font-size: 14px; font-weight: 600; margin-top: 6px; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.bar-v { width: 100%; max-width: 34px; background: var(--ink); border-radius: 6px 6px 2px 2px; }
.bar-col small { color: var(--muted); font-size: 12px; font-weight: 600; }
.store-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.legend button:disabled { cursor: default; color: inherit; }

/* ---------- drawer ---------- */
.shade { position: fixed; inset: 0; background: rgba(18, 20, 26, .35); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100%); background: var(--card); z-index: 21; display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(18, 20, 26, .15); }
.drawer-head { padding: 22px 24px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.drawer-head h2 { margin: 0; font-size: 22px; }
.drawer-body { overflow: auto; padding: 8px 16px 24px; }
.x { border: 0; background: var(--bg); width: 36px; height: 36px; border-radius: 50%; font-size: 18px; }
.buy { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 8px; border-bottom: 1px solid var(--line); }
.buy .nm { font-weight: 700; }
.buy .am { font-weight: 700; text-align: right; }
.buy .meta { color: var(--muted); font-size: 13px; }
.buy select { font-size: 13px; border: 1px solid var(--line); border-radius: 8px; padding: 2px 6px; background: #fff; color: var(--muted); }

/* ---------- upload ---------- */
.drop { border: 2px dashed #C9CEDA; border-radius: var(--radius); background: var(--card); padding: 48px 24px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop h2 { margin: 12px 0 6px; }
.files { display: grid; gap: 8px; margin: 16px 0; }
.file { display: flex; justify-content: space-between; align-items: center; background: var(--card); border-radius: 12px; padding: 10px 14px; font-weight: 600; }
.file button { border: 0; background: none; color: var(--muted); font-size: 18px; }
.find { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--line); cursor: pointer; }
.find input { width: 18px; height: 18px; accent-color: var(--accent); }
.find .nm { flex: 1; font-weight: 700; }
.two { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; align-items: start; }

/* ---------- subscriptions ---------- */
.subs .row { display: flex; align-items: center; gap: 14px; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.subs .row:last-child { border-bottom: 0; }
.subs .nm { flex: 1; font-weight: 700; }
.subs .meta { color: var(--muted); font-size: 13px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; display: grid; place-items: center; z-index: 30; background: rgba(18, 20, 26, .35); padding: 20px; }
.modal .card { width: 100%; max-width: 420px; }

@media (max-width: 980px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .grid > :last-child { grid-column: 1 / -1; }
  .two { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 32px 24px; }
  .auth-side h1 { font-size: 34px; }
  .grid { grid-template-columns: 1fr; }
  .top-in { gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  main { padding: 20px 16px 48px; }
  .flow { overflow-x: auto; }
  .flow svg { min-width: 680px; }
  h1 { font-size: 28px; }
}

/* ---------- money platform steps 2–4 ---------- */
.nudge { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; border-left: 5px solid #3F7D20; }
.minis { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-bottom: 20px; }
.mini { display: grid; gap: 6px; color: var(--ink); }
.mini:hover { text-decoration: none; box-shadow: 0 4px 18px rgba(18, 20, 26, .08); }
.mini small { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.mini b { font-size: 17px; }
.mini span { color: var(--accent); font-weight: 600; font-size: 14px; }
.progress { height: 10px; border-radius: 5px; background: #EEF0F4; overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 5px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.qrow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); }
.habits { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.habit h2 { font-size: 22px; margin: 6px 0 2px; }
.habit-top { display: flex; align-items: center; gap: 8px; }
.habit-top .sw { width: 10px; height: 10px; border-radius: 3px; }
.habit-top .linkish { margin-left: auto; }
.linkish { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; font-size: 13px; }
.often { margin: 0 0 12px; color: var(--muted); font-weight: 600; }
.big { font-size: 40px; font-weight: 800; letter-spacing: -1.2px; line-height: 1; }
.big small { font-size: 16px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.save { background: var(--green-soft); color: #146B3D; border-radius: 14px; padding: 12px 14px; font-weight: 600; font-size: 14px; display: grid; gap: 6px; margin-top: 12px; }
.goal { margin-bottom: 20px; }
.goal-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.goal-nums { margin-bottom: 8px; }
.goal-nums b { font-size: 28px; letter-spacing: -0.6px; }
.nudge-line { font-weight: 700; margin: 12px 0 0; }
.goal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.coach:not(:empty) { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 18px; }
.step { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.step .num { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.step .amt { color: var(--green); white-space: nowrap; }
.afford { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
@media (max-width: 720px) {
  .row2 { grid-template-columns: 1fr; }
  .stats { flex-wrap: wrap; }
}
