/* FINAPLA Personal (ADR-0140 point 6.10): soft grey, white rounded cards, colour on a few cards only.
   Deliberately different from the business dashboard so the two are never confused. */
:root { --bg: #F3F2F6; --card: #FFFFFF; --ink: #17161C; --ink2: #3F3C4E; --muted: #6B6878; --line: #F1EFF6;
  --soft: #F6F5F9; --violet: #4B3FD6; --ok: #1F7A4D; --ok-soft: #E3F6EC; --warn: #8A5A12; --warn-soft: #FFF0DC;
  --bad: #B42850; --bad-soft: #FFE6EC; --lime: #C9F07A; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 Inter, system-ui, -apple-system, sans-serif; }
button, input, select { font: inherit; color: inherit; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; flex: 1; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); display: grid; place-items: center; }
.toggle { display: inline-flex; padding: 4px; border-radius: 16px; background: #E6E4EC; gap: 2px; }
.toggle a, .toggle span { height: 34px; padding: 0 14px; border-radius: 12px; display: inline-flex; align-items: center;
  font-weight: 600; font-size: 13px; text-decoration: none; color: var(--ink2); }
.toggle span[aria-current] { background: var(--card); color: var(--ink); box-shadow: 0 2px 6px rgba(20,16,40,.12); }
h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
h2 { margin: 0; font-size: 15px; font-weight: 600; }
.sub { color: var(--muted); font-size: 13px; }
.card { background: var(--card); border-radius: 22px; padding: 20px; display: flex; flex-direction: column; gap: 12px;
  animation: rise .6s cubic-bezier(.25,.8,.25,1) both; }
.hero { color: #fff; background: linear-gradient(135deg,#5B4BEB 0%,#6C63FF 45%,#3E7BFA 100%);
  box-shadow: 0 14px 30px -14px rgba(76,64,235,.6); }
.hero .sub { color: #E4E0FF; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.btn { height: 42px; padding: 0 18px; border: 0; border-radius: 21px; background: var(--ink); color: #fff; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.light { background: var(--soft); color: var(--ink); }
.btn.small { height: 34px; padding: 0 12px; font-size: 12px; border-radius: 17px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, .field input:focus-visible, .field select:focus-visible, .toggle a:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--muted); }
.field input, .field select { height: 44px; border: 1px solid #E2E0EA; border-radius: 14px; padding: 0 14px; background: #fff; color: var(--ink); font-size: 16px; }
/* owner, 24 Nov 2026: typed text was white on white inside the coloured card; 16px also stops phones zooming in */
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1 1 160px; }
.member { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; border: 0; background: transparent;
  width: 100%; text-align: left; cursor: pointer; transition: background .25s; }
.member[aria-pressed="true"] { background: var(--soft); }
.av { width: 42px; height: 42px; border-radius: 14px; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px; flex: none; }
.grow { flex: 1; min-width: 0; }
.name { font-weight: 600; }
.tag { font-size: 11px; border-radius: 10px; padding: 3px 9px; font-weight: 600; white-space: nowrap; }
.r-Head { background: var(--ink); color: #fff; } .r-Partner { background: #EEEBFF; color: var(--violet); }
.r-Member { background: #E4EEFF; color: #2453B8; } .r-Child { background: var(--warn-soft); color: var(--warn); }
.r-Helper { background: var(--ok-soft); color: var(--ok); }
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 5px; vertical-align: middle; }
.wait { background: #F2A13A; animation: blink 1.4s ease-in-out infinite; } .on { background: #2BB673; }
.seg { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 3px; padding: 4px; border-radius: 16px; background: var(--bg); }
.seg button { height: 36px; border: 0; border-radius: 12px; background: transparent; font-weight: 600; font-size: 12px; color: #55526A; cursor: pointer; transition: background .25s; }
.seg button[aria-checked="true"] { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(20,16,40,.12); }
.perm { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.mark { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 13px; transition: background .35s; }
.m-yes { background: var(--ok-soft); color: var(--ok); } .m-part { background: var(--warn-soft); color: var(--warn); } .m-no { background: var(--bg); color: #9A97A8; }
.code { font: 700 28px/1.2 ui-monospace, Menlo, monospace; letter-spacing: .18em; background: var(--lime); color: var(--ink);
  border-radius: 16px; padding: 14px; text-align: center; animation: pop .4s ease both; }
.note { font-size: 12px; color: var(--muted); }
.err { background: var(--bad-soft); color: var(--bad); border-radius: 14px; padding: 10px 14px; font-weight: 500; }
.center { min-height: 70vh; display: grid; place-items: center; }
.sr { position: absolute; left: -9999px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 600px) { h1 { font-size: 22px; } .wrap { padding: 12px; } }

/* --- app layout (stage 2-5) --- */
.layout { display: flex; gap: 16px; align-items: flex-start; }
.rail { flex: 0 0 220px; position: sticky; top: 12px; background: var(--card); border-radius: 22px; padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; }
.rail .who { display: flex; gap: 10px; align-items: center; padding: 6px 8px 14px; }
.nav { text-align: left; border: 0; background: transparent; padding: 10px 12px; border-radius: 12px; cursor: pointer; color: var(--ink2); font-size: 14px; }
.nav.on { background: var(--ink); color: #fff; font-weight: 600; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; padding-bottom: 96px; }
.vhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; align-items: stretch; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.rowb { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.big { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.mid { font-size: 20px; font-weight: 600; padding-top: 6px; }
.pill { font-size: 12px; background: rgba(255,255,255,.2); border-radius: 10px; padding: 3px 9px; border: 0; color: inherit; }
.linkish { cursor: pointer; }
.linkbtn { border: 0; background: none; color: var(--violet); cursor: pointer; font-size: 12px; padding: 4px; }
.coral { color: #fff; background: linear-gradient(135deg,#E8505B 0%,#F0789A 55%,#F59E6B 100%); box-shadow: 0 14px 30px -14px rgba(232,80,91,.6); }
.coral .sub, .coral .note { color: #fff; }
.dark { background: #17161C; color: #fff; }
.violet { color: #fff; background: linear-gradient(135deg,#2A2450 0%,#4B3FD6 55%,#8A6CFF 100%); }
.violet .sub { color: #D9D4FF; }
.mint { color: #0F2A1C; background: linear-gradient(135deg,#B8F0CF 0%,#C9F07A 55%,#F2E27A 100%); }
.soft { background: var(--soft); border-radius: 14px; padding: 10px 14px; }
.dbars { display: flex; align-items: flex-end; gap: 3px; height: 64px; margin-top: auto; }
.dbar { flex: 1; background: #fff; border-radius: 3px; }
.grow-y { transform-origin: bottom; animation: growY .8s cubic-bezier(.25,.8,.25,1) both; }
.grow-x { transform-origin: left; animation: growX .9s cubic-bezier(.25,.8,.25,1) .2s both; }
.track { height: 8px; border-radius: 4px; background: rgba(23,22,28,.07); overflow: hidden; }
.fill { height: 8px; border-radius: 4px; }
.catrow { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.cbar { width: 34%; }
.sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.erow, .brow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); animation: rise .45s ease both; flex-wrap: wrap; }
.erow-del { display: flex; align-items: center; gap: 6px; }
.erow-del .erow { flex: 1; }
.x { border: 0; background: var(--soft); width: 30px; height: 30px; border-radius: 10px; cursor: pointer; color: var(--muted); }
.eav { width: 34px; height: 34px; border-radius: 11px; background: #EEEBFF; color: var(--violet); display: grid; place-items: center; font-weight: 600; flex: none; text-transform: uppercase; }
.hub { position: relative; min-height: 230px; overflow: hidden; }
.hubc { position: absolute; left: calc(50% - 30px); top: calc(50% - 30px); width: 60px; height: 60px; }
.hubdot { position: absolute; inset: 0; border-radius: 50%; background: #C9F07A; animation: pulse 2.4s ease-out infinite; }
.hubhome { position: absolute; inset: 0; border-radius: 50%; background: var(--ink); display: grid; place-items: center; box-shadow: 0 0 0 6px #EEF9D6; }
.orb { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 4px; animation: float 5s ease-in-out infinite; }
.orb .av { width: 40px; height: 40px; border-radius: 13px; font-size: 14px; }
.o0 { left: 12%; top: 14%; } .o1 { right: 12%; top: 14%; animation-delay: 1.2s; } .o2 { left: 12%; bottom: 12%; animation-delay: 2.1s; }
.o3 { right: 12%; bottom: 12%; animation-delay: .7s; } .o4 { left: 50%; top: 4%; transform: translateX(-50%); animation-delay: 1.6s; } .o5 { left: 50%; bottom: 2%; animation-delay: .3s; }
.wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; align-content: start; }
.wcard, .gcard { text-align: left; border: 0; cursor: pointer; border-radius: 22px; padding: 16px; min-height: 130px; display: flex; flex-direction: column; gap: 6px;
  transition: transform .35s cubic-bezier(.25,.8,.25,1), box-shadow .35s; animation: rise .6s cubic-bezier(.25,.8,.25,1) both; }
.gcard { background: var(--card); }
.wcard[aria-pressed="true"], .gcard[aria-pressed="true"] { transform: translateY(-4px); box-shadow: 0 16px 30px -14px rgba(40,30,90,.45); outline: 2px solid var(--ink); outline-offset: 3px; }
.wbal { margin-top: auto; font-size: 20px; font-weight: 700; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip { height: 36px; padding: 0 14px; border-radius: 18px; border: 0; background: var(--card); cursor: pointer; font-weight: 500; transition: background .25s, color .25s; }
.card .chip { background: var(--soft); }
.chip[aria-pressed="true"] { background: var(--ink) !important; color: #fff; }
.legend { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; text-align: left; min-height: 40px; }
.legend[aria-pressed="true"] { background: var(--soft); }
.donutw { position: relative; width: 190px; height: 190px; }
.dlabel { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.waiting { background: linear-gradient(135deg,#EEEBFF,#FFE9EF); }
.wrow { display: flex; gap: 10px; align-items: center; background: #fff; border-radius: 16px; padding: 10px 12px; flex-wrap: wrap; }
.wrow select, .payf select, .payf input { height: 36px; border: 1px solid #E2E0EA; border-radius: 12px; padding: 0 10px; background: #fff; }
.payf { display: flex; gap: 6px; align-items: center; }
.payf input { width: 120px; }
.bdate { width: 40px; text-align: center; display: flex; flex-direction: column; }
.warnbox { box-shadow: inset 4px 0 0 #E8505B; }
.cheques { display: flex; align-items: center; margin-top: 8px; }
.chq { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: rgba(255,255,255,.25); animation: pop .5s ease both; }
.chq.done { background: rgba(255,255,255,.95); color: var(--ok); } .chq.now { background: var(--ink); box-shadow: 0 0 0 4px rgba(255,255,255,.55); }
.chqline { flex: 1; height: 2px; background: rgba(255,255,255,.45); }
.okmark, .okc { color: var(--ok); font-weight: 700; } .badc { color: var(--bad); }
.loan { padding: 12px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.loan.settled { opacity: .6; } .loan.settled b:first-child { text-decoration: line-through; }
.seg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 18px; background: #E6E4EC; }
.seg2 button { height: 40px; border: 0; border-radius: 14px; background: transparent; font-weight: 600; cursor: pointer; }
.seg2 button[aria-checked="true"] { background: #fff; box-shadow: 0 2px 6px rgba(20,16,40,.12); }
.btn.lime { background: var(--lime); color: var(--ink); }
.okmsg { background: var(--ok-soft); color: var(--ok); border-radius: 14px; padding: 10px 14px; font-weight: 500; animation: pop .3s ease both; }
.checkline { display: flex; gap: 8px; align-items: center; font-size: 14px; min-height: 36px; }
.scrim { position: fixed; inset: 0; background: rgba(23,22,28,.35); z-index: 40; animation: fade .2s ease both; }
.sheet { position: fixed; z-index: 41; right: 16px; top: 16px; bottom: 16px; width: min(440px, calc(100% - 32px)); background: #fff; border-radius: 24px; padding: 20px;
  overflow: auto; display: flex; flex-direction: column; gap: 12px; animation: slideIn .35s cubic-bezier(.25,.8,.25,1) both; box-shadow: 0 30px 60px -20px rgba(23,22,28,.4); }
.sheetform { display: flex; flex-direction: column; gap: 12px; }
.bottom { display: none; }
.more { display: none; }
@keyframes growY { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pulse { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes float { 0%,100% { translate: 0 0; } 50% { translate: 0 -6px; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.ring { animation: ringIn 1.3s cubic-bezier(.25,.8,.25,1) .3s both; }
@keyframes ringIn { from { stroke-dashoffset: var(--c); } }
@media (max-width: 860px) {
  .rail { display: none; }
  .bottom { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); position: fixed; left: 12px; right: 12px; bottom: 14px; height: 64px; border-radius: 32px;
    background: var(--ink); align-items: center; z-index: 30; box-shadow: 0 12px 30px -10px rgba(23,22,28,.5); padding: 0 6px; }
  .bottom button { height: 48px; border: 0; background: transparent; color: #C9C6D4; font-size: 12px; border-radius: 20px; cursor: pointer; }
  .bottom button.on { background: #fff; color: var(--ink); font-weight: 600; }
  .bottom button.add { background: var(--lime); color: var(--ink); font-weight: 700; }
  .more { display: flex; flex-direction: column; position: fixed; right: 16px; bottom: 90px; z-index: 31; background: #fff; border-radius: 18px; padding: 8px; box-shadow: 0 20px 40px -12px rgba(23,22,28,.35); animation: pop .2s ease both; }
  .more button { border: 0; background: none; text-align: left; padding: 12px 14px; border-radius: 12px; cursor: pointer; }
  .sheet { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; max-height: 88vh; animation-name: rise; }
  .big { font-size: 26px; }
  .payf input { width: 100px; }
}
