@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root{font-family:"DM Sans",system-ui,sans-serif;color:#1c2036;background:#f8f9fd;--muted:#60677e;--border:#e7e9f2;--brand:#5945ec;--tint:#efedff;--green:#08765e;--red:#af3b53;font-synthesis:none}
*{box-sizing:border-box}
body{margin:0;min-width:300px}
button,input,select{font:inherit}
button,a,input,select{ -webkit-tap-highlight-color:transparent }
button{cursor:pointer}
a{color:inherit;text-decoration:none}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #8777ff;outline-offset:3px}
h1,h2,h3,p{margin:0}
h1,h2,h3,.brand,.money,.total{font-family:Manrope,system-ui,sans-serif}
.sidebar{background:#fff;border-bottom:1px solid var(--border);padding:16px 20px}
.brand{display:inline-flex;align-items:center;gap:10px;font-size:22px;letter-spacing:-.8px;font-weight:800}
.brand-mark{width:36px;height:36px;border-radius:11px;background:var(--brand);color:white;display:grid;place-items:center;font-weight:800;font-size:25px;line-height:1}
.side-groups{display:flex;gap:8px;align-items:center;margin-top:14px}
.side-label,.side-footer{display:none}
#groups{display:flex;gap:6px;overflow:auto}
.group-link,.new-group{display:flex;gap:9px;align-items:center;white-space:nowrap;padding:9px 11px;border:0;background:transparent;border-radius:9px;color:var(--muted);font-weight:700;font-size:14px}
.group-link.active{color:#4935d6;background:var(--tint)}
.new-group{border:1px dashed #d8dbea}
.new-group:hover,.group-link:hover{background:#f3f1ff}
.main{max-width:1400px;margin:auto;padding:20px 16px 40px}
.topbar,.hero,.section-head,.row,.row-meta,.actions,.balance-row,.transfer,.summary-head{display:flex;align-items:center}
.topbar{justify-content:space-between;gap:10px;margin-bottom:20px;color:var(--muted);font-size:14px}
.crumb{display:flex;align-items:center;min-width:0;gap:8px}
.crumb strong{color:#272942;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:10px;font-weight:700;padding:10px 14px;min-height:42px;border:1px solid var(--border);background:#fff;color:#353950;white-space:nowrap;font-size:14px}
.btn:hover{background:#f2f0ff}
.btn.primary{color:#fff;background:var(--brand);border-color:var(--brand);box-shadow:0 4px 10px #5945ec24}
.btn.primary:hover{background:#4934da}
.btn.danger{color:#a52845}
.btn:disabled{opacity:.6;cursor:wait}
.icon{display:inline-grid;place-items:center;width:19px;height:19px;font-size:19px;line-height:1;flex:none}
.hero{position:relative;overflow:hidden;min-height:178px;padding:22px 19px;gap:15px;border-radius:19px;background:linear-gradient(110deg,#eae7ff 0%,#f0edff 60%,#e3ddff 100%);border:1px solid #e6e0ff}
.hero-art{position:absolute;right:-65px;top:50%;transform:translateY(-50%) rotate(-12deg);width:235px;height:235px;border:22px solid #d8ceff;border-radius:50%;box-shadow:0 0 0 19px #ece5ff,inset 0 0 0 16px #e8dfff;opacity:.75;pointer-events:none}
.hero-art::before,.hero-art::after{content:"";position:absolute;background:#c7b8ff;border-radius:28px;inset:49% -19% auto;height:16px;transform:rotate(-25deg)}
.hero-art::after{transform:rotate(65deg)}
.hero-title{position:relative;z-index:1;min-width:0}
.hero-icon{position:relative;z-index:1;flex:none;width:56px;height:56px;display:grid;place-items:center;background:#fff;border:1px solid #fff;border-radius:16px;font-size:28px;box-shadow:0 8px 20px #7260be20}
h1{font-size:clamp(24px,5vw,40px);letter-spacing:-.055em;line-height:1.12;overflow-wrap:anywhere}
.hero p{color:#555372;font-size:14px;margin-top:8px}
.demo-tag{display:inline-flex;align-items:center;gap:5px;background:#fff9;color:#504780;border-radius:20px;padding:4px 9px;margin-top:10px;font-size:12px;font-weight:700}
.tabs{display:flex;gap:13px;border-bottom:1px solid var(--border);margin:13px 0 22px}
.tabs button{display:flex;align-items:center;gap:7px;padding:15px 7px 13px;border:0;border-bottom:3px solid transparent;background:transparent;color:var(--muted);font-weight:700;font-size:14px}
.tabs button[aria-selected="true"]{color:#4d39de;border-bottom-color:#5b45f1}
.layout{display:grid;gap:18px;align-items:start}
.section-head{justify-content:space-between;gap:10px;margin-bottom:13px}
h2{font-size:21px;letter-spacing:-.55px;font-weight:800}
h3{font-size:17px;letter-spacing:-.35px}
.subtext{font-size:14px;color:var(--muted);margin-top:4px}
.card{background:#fff;border:1px solid var(--border);border-radius:15px;overflow:hidden}
.row,.transfer{width:100%;text-align:left;gap:11px;padding:14px 12px;background:#fff;border:0;color:inherit}
.row + .row,.transfer + .transfer,.balance-row + .balance-row{border-top:1px solid #eef0f6}
button.row:hover{background:#faf9ff}
.tile{width:40px;height:40px;flex:none;display:grid;place-items:center;border-radius:11px;background:#eeebff;color:#573de0;font-size:20px}
.tile.food{background:#fff0e3}.tile.stay{background:#efebff}.tile.travel{background:#e4f5ef}.tile.shop{background:#ffedf4}
.row-text,.transfer-text{flex:1;min-width:0}
.row strong,.transfer strong{display:block;overflow-wrap:anywhere;font-size:14px;font-weight:700}
.row small,.transfer small{display:block;margin-top:4px;color:var(--muted);font-size:13px}
.money{font-size:15px;font-weight:800;white-space:nowrap}
.chevron{color:#777d93;font-size:21px}
.summary{padding:17px}
.summary-head{justify-content:space-between;gap:7px}
.total{font-size:31px;letter-spacing:-1.1px;font-weight:800;margin-top:8px}
.summary hr{border:0;border-top:1px solid var(--border);margin:17px 0}
.balance-row{gap:9px;padding:9px 0;overflow-wrap:anywhere}
.balance-row .money{margin-left:auto}
.avatar{display:grid;place-items:center;width:31px;height:31px;border-radius:50%;flex:none;background:#eee9ff;color:#4d36bf;font-size:12px;font-weight:800}
.avatar[data-color="1"]{background:#dff6ee;color:#14664d}
.avatar[data-color="2"]{background:#ffecdf;color:#873e12}
.avatar[data-color="3"]{background:#e4ecff;color:#344da0}
.positive{color:var(--green)}.negative{color:var(--red)}.neutral{color:var(--muted)}
.balance-link{margin-top:10px;width:100%;color:#4d39de;background:#f8f7ff;border-color:#eeebff}
.empty{padding:24px 17px;color:var(--muted);line-height:1.5}
.panel{padding:16px;margin-bottom:16px}
.panel > h2{margin-bottom:10px}
.switch{display:flex;gap:12px;justify-content:space-between;align-items:center;margin-bottom:14px}
.switch input{width:23px;height:23px;accent-color:var(--brand);flex:none}
.transfer{justify-content:space-between;flex-wrap:wrap}
.transfer .btn{min-height:35px;padding:6px 9px}
dialog{border:1px solid var(--border);border-radius:19px;padding:21px;width:min(94%,480px);max-height:90dvh;color:inherit;box-shadow:0 18px 80px #241c4a33}
dialog::backdrop{background:#17133366}
.dialog-head{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-bottom:17px}
.close{background:#f2f1fa;border:0;border-radius:8px;width:38px;height:38px;color:#39334c;font-size:24px}
.field{display:grid;gap:6px;margin:0 0 13px;font-size:14px;font-weight:700}
.field input,.field select,.participant input[type="text"]{width:100%;min-height:43px;border:1px solid #dcddea;border-radius:8px;background:white;color:inherit;padding:8px 10px;font-size:16px}
.field-pair{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.field-pair .field{min-width:0}
.participant{display:flex;align-items:center;gap:9px;min-height:40px}
.participant input[type="checkbox"]{width:18px;height:18px;accent-color:var(--brand)}
.participant input[type="text"]{margin-left:auto;width:95px}
fieldset{border:1px solid var(--border);border-radius:10px;padding:7px 10px;margin:0 0 13px;min-width:0}
legend{font-weight:700;font-size:14px;padding:0 5px}
.actions{justify-content:flex-end;gap:8px;margin-top:16px;flex-wrap:wrap}
.actions .danger{margin-right:auto}
.error{color:#a52845;font-size:14px;line-height:1.5}
#toast:not(:empty){position:fixed;bottom:20px;left:50%;transform:translateX(-50%);background:#24203c;color:#fff;padding:12px 17px;border-radius:10px;z-index:3;max-width:90%;font-size:14px;text-align:center}
[hidden]{display:none!important}

@media(min-width:630px){.main{padding:28px 28px 40px}.hero{padding:25px 29px;gap:20px}.hero-icon{width:70px;height:70px;font-size:33px;border-radius:20px}.hero-art{right:35px;width:250px;height:250px}.row{padding:15px 17px}.summary{padding:19px}.tile{width:44px;height:44px}.tabs{gap:24px}}
@media(min-width:900px){body{padding-left:228px}.sidebar{position:fixed;inset:0 auto 0 0;width:228px;padding:28px 16px;border-bottom:0;border-right:1px solid var(--border);display:flex;flex-direction:column}.brand{margin-left:8px}.side-groups{display:block;flex:1;margin-top:43px;overflow:auto}.side-label{display:block;color:#686d83;font-size:11px;font-weight:800;letter-spacing:1.02px;margin:0 9px 12px}#groups{display:grid}.group-link,.new-group{width:100%;min-height:43px}.new-group{margin-top:10px}.side-footer{display:flex;gap:9px;align-items:center;border-top:1px solid var(--border);padding:17px 2px 0;font-size:13px}.side-footer small{display:block;color:var(--muted);font-size:11px;margin-top:3px}.brand-mark.small{width:28px;height:28px;font-size:19px;border-radius:8px}.main{padding:28px 32px 44px}.topbar{margin-bottom:23px}.layout{grid-template-columns:minmax(0,1fr) minmax(225px,31%);gap:20px}}
@media(min-width:1150px){.main{padding-inline:40px}.layout{grid-template-columns:minmax(0,1fr) minmax(280px,32%);gap:23px}.hero{min-height:190px}.hero-art{right:76px}.summary{padding:21px}.section-head{margin-bottom:16px}}
.group-tools{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px}
.member-session{display:flex;flex-wrap:wrap;gap:8px;align-items:center;color:#555372;font-size:14px;margin-top:8px}
.member-session button{padding:5px 9px;border:1px solid #dad3fd;border-radius:8px;background:#fff9;color:#4935d6;font-weight:700}
.lock-card{margin-top:20px;max-width:460px;padding:20px}
.lock-card form{margin-top:16px}
.lock-card form .btn{margin-top:8px}
.older-button{margin-top:12px}
@media(max-width:430px){.topbar{flex-wrap:wrap}.group-tools{margin-left:auto}}
