﻿*{box-sizing:border-box;margin:0;padding:0}
:root{
--blue:#185FA5;--blue-light:#E6F1FB;--blue-mid:#378ADD;--blue-dark:#0C447C;
--teal:#0F6E56;--teal-light:#E1F5EE;
--amber:#BA7517;--amber-light:#FAEEDA;
--coral:#993C1D;--coral-light:#FAECE7;
--gray0:#F1EFE8;--gray1:#D3D1C7;--gray2:#888780;--gray3:#5F5E5A;--gray4:#2C2C2A;
--red-light:#FCEBEB;--red:#A32D2D;
--green-light:#EAF3DE;--green:#3B6D11;
--radius:12px;--radius-sm:8px;
}
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;background:#f5f7fa;color:var(--gray4);min-height:100vh;max-width:480px;margin:0 auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior-y:none;padding-bottom:env(safe-area-inset-bottom,0px)}
h1{font-size:22px;font-weight:600}h2{font-size:18px;font-weight:500}h3{font-size:15px;font-weight:500}
input,select,textarea{width:100%;padding:10px 12px;border:1px solid var(--gray1);border-radius:var(--radius-sm);font-size:15px;background:#fff;color:var(--gray4);outline:none;transition:border .15s}
input:focus,select:focus,textarea:focus{border-color:var(--blue-mid)}
input:disabled,select:disabled,textarea:disabled{background:var(--gray0);color:var(--gray2)}
textarea{resize:vertical;min-height:64px}
button{cursor:pointer;border:none;border-radius:var(--radius-sm);font-size:15px;font-weight:500;padding:10px 16px;transition:all .15s;display:inline-flex;align-items:center;justify-content:center;gap:6px}
.btn-primary{background:var(--blue);color:#fff}.btn-primary:hover{background:var(--blue-dark)}
.btn-secondary{background:#fff;border:1px solid var(--gray1);color:var(--gray3)}.btn-secondary:hover{background:var(--gray0)}
.btn-danger{background:var(--red-light);color:var(--red);border:1px solid #F7C1C1}
.btn-sm{padding:6px 12px;font-size:13px}
.card{background:#fff;border-radius:var(--radius);border:0.5px solid var(--gray1);padding:1rem 1.25rem;margin-bottom:12px}
.tag{display:inline-block;padding:3px 10px;border-radius:20px;font-size:12px;font-weight:500}
.tag-transport{background:#E6F1FB;color:var(--blue-dark)}
.tag-hotel{background:var(--amber-light);color:var(--amber)}
.tag-restaurant{background:var(--teal-light);color:var(--teal)}
.tag-tour{background:#FBEAF0;color:#993556}
.tag-other{background:var(--gray0);color:var(--gray3)}
.avatar{width:34px;height:34px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:600;flex-shrink:0;color:#20303f}
.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,0.45);z-index:100;display:flex;align-items:flex-end;justify-content:center}
.modal{background:#fff;border-radius:var(--radius) var(--radius) 0 0;width:100%;max-width:480px;max-height:85dvh;max-height:85vh;overflow-y:auto;padding:1.25rem}
.modal-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem;position:sticky;top:0;background:#fff;padding-top:2px;z-index:1}
.field{margin-bottom:14px}
.field label{display:block;font-size:13px;font-weight:500;color:var(--gray3);margin-bottom:5px}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.nav{display:flex;border-bottom:1px solid var(--gray1);background:#fff;position:sticky;top:0;z-index:10}
.nav-btn{flex:1;padding:14px 8px;font-size:13px;font-weight:500;color:var(--gray2);border:none;background:none;cursor:pointer;border-bottom:2px solid transparent;transition:all .15s;display:flex;align-items:center;justify-content:center;gap:5px}
.nav-btn.active{color:var(--blue);border-bottom-color:var(--blue)}
.header{background:var(--blue);color:#fff;padding:16px;padding-top:calc(16px + env(safe-area-inset-top,0px));display:flex;align-items:center;gap:12px}
.header-back{background:rgba(255,255,255,0.2);border:none;color:#fff;width:34px;height:34px;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;padding:0}
.fab{position:fixed;bottom:calc(24px + env(safe-area-inset-bottom,0px));right:calc(50% - 216px);width:52px;height:52px;border-radius:50%;background:var(--blue);color:#fff;border:none;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 4px 12px rgba(24,95,165,0.4);padding:0}
@media(max-width:480px){.fab{right:20px}}
.empty{text-align:center;padding:3rem 1rem;color:var(--gray2)}
.chip-group{display:flex;flex-wrap:wrap;gap:8px;margin-top:6px}
.chip{padding:6px 14px;border-radius:20px;border:1px solid var(--gray1);font-size:13px;cursor:pointer;background:#fff;transition:all .15s;user-select:none}
.chip.selected{background:var(--blue);color:#fff;border-color:var(--blue)}
.balance-row{display:flex;align-items:center;justify-content:space-between;padding:12px 0;border-bottom:0.5px solid var(--gray0)}
.balance-row:last-child{border-bottom:none}
.owe-badge{padding:4px 10px;border-radius:20px;font-size:13px;font-weight:600;text-align:right}
.owes{background:var(--coral-light);color:var(--coral)}
.expense-row{padding:12px 0;border-bottom:0.5px solid var(--gray0);display:flex;gap:10px;cursor:pointer}
.expense-row:hover{background:#fafafa}
.expense-row:last-child{border-bottom:none}
.currency-pills{display:flex;flex-wrap:wrap;gap:8px;margin-top:6px}
.currency-pill{padding:5px 14px;border-radius:20px;border:1px solid var(--gray1);font-size:13px;cursor:pointer;background:#fff;user-select:none;transition:all .15s}
.currency-pill.sel{background:var(--blue-light);border-color:var(--blue-mid);color:var(--blue-dark);font-weight:500}
.trip-card{background:#fff;border-radius:var(--radius);border:0.5px solid var(--gray1);padding:1rem 1.25rem;margin-bottom:10px;cursor:pointer;display:flex;align-items:center;gap:12px;transition:all .15s}
.trip-card:hover{border-color:var(--blue-mid);background:var(--blue-light)}
.trip-icon{width:44px;height:44px;border-radius:var(--radius-sm);background:var(--blue-light);display:flex;align-items:center;justify-content:center;font-size:22px;flex-shrink:0}
.split-check{display:flex;align-items:center;gap:10px;padding:8px 0;cursor:pointer}
.split-check input[type=checkbox]{width:18px;height:18px;cursor:pointer;accent-color:var(--blue)}
.section-title{font-size:12px;font-weight:600;color:var(--gray2);text-transform:uppercase;letter-spacing:.05em;margin:16px 0 8px}
.icon{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;display:inline-block;vertical-align:middle;flex-shrink:0}
/* Settings panel */
.settings-row{display:flex;align-items:center;justify-content:space-between;padding:13px 0;border-bottom:0.5px solid var(--gray0)}
.settings-row:last-child{border-bottom:none}
.settings-label{font-size:15px;font-weight:500}
.settings-sub{font-size:12px;color:var(--gray2);margin-top:2px}
/* Custom dialogs */
.dialog-overlay{position:fixed;inset:0;background:rgba(0,0,0,0.45);z-index:300;display:flex;align-items:center;justify-content:center;padding:1.5rem}
.dialog{background:#fff;border-radius:var(--radius);width:100%;max-width:320px;overflow:hidden}
.dialog-body{padding:1.25rem 1.25rem .75rem}
.dialog-icon{width:44px;height:44px;border-radius:50%;display:flex;align-items:center;justify-content:center;margin:0 auto 12px}
.dialog-title{font-size:16px;font-weight:600;text-align:center;margin-bottom:6px}
.dialog-msg{font-size:14px;color:var(--gray3);text-align:center;line-height:1.5}
.dialog-actions{display:flex;border-top:0.5px solid var(--gray1)}
.dialog-actions button{flex:1;padding:14px;font-size:15px;font-weight:500;border:none;background:none;cursor:pointer;transition:background .15s}
.dialog-actions button:first-child{border-right:0.5px solid var(--gray1);color:var(--gray3)}
.dialog-actions button:first-child:hover{background:var(--gray0)}
.dialog-actions button.da-ok{color:var(--blue)}.dialog-actions button.da-ok:hover{background:var(--blue-light)}
.dialog-actions button.da-danger{color:var(--red)}.dialog-actions button.da-danger:hover{background:var(--red-light)}
.dialog-actions.single button{border-right:none;color:var(--blue)}
.dialog-actions.single button:hover{background:var(--blue-light)}
/* Auth */
.auth-wrap{position:fixed;inset:0;background:var(--blue);display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:200;padding:2rem 1.5rem;padding-top:calc(2rem + env(safe-area-inset-top,0px));overflow-y:auto}
.auth-logo{width:72px;height:72px;border-radius:20px;margin-bottom:14px;box-shadow:0 8px 24px rgba(0,0,0,0.25)}
.auth-title{color:#fff;font-size:26px;font-weight:700;margin-bottom:4px;letter-spacing:-.5px}
.auth-sub{color:rgba(255,255,255,0.75);font-size:13px;margin-bottom:22px;text-align:center}
.auth-card{background:#fff;border-radius:var(--radius);padding:1.5rem;width:100%;max-width:320px}
.auth-err{color:var(--red);font-size:13px;margin-top:10px;text-align:center;min-height:18px}
.tab-switch{display:flex;background:var(--gray0);border-radius:20px;padding:3px;margin-bottom:18px}
.tab-switch button{flex:1;padding:9px;border-radius:17px;border:none;background:none;font-size:14px;font-weight:500;color:var(--gray3);cursor:pointer}
.tab-switch button.active{background:#fff;color:var(--blue);box-shadow:0 1px 3px rgba(0,0,0,0.15)}
.invite-banner{background:var(--blue-light);border:1px solid var(--blue-mid);border-radius:var(--radius-sm);padding:10px 12px;margin-bottom:14px;font-size:13px;color:var(--blue-dark);line-height:1.4}
/* Friends */
.friend-row{display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:0.5px solid var(--gray0)}
.friend-row:last-child{border-bottom:none}
.pending-actions{display:flex;gap:6px;flex-shrink:0}
.badge-count{background:var(--coral);color:#fff;border-radius:20px;font-size:11px;font-weight:600;padding:1px 6px;min-width:16px;text-align:center;line-height:1.5}
/* Autocomplete */
.autocomplete-wrap{position:relative}
.autocomplete-list{position:absolute;top:100%;left:0;right:0;background:#fff;border:1px solid var(--gray1);border-radius:var(--radius-sm);box-shadow:0 4px 14px rgba(0,0,0,0.14);max-height:190px;overflow-y:auto;z-index:20;margin-top:4px}
.autocomplete-item{padding:9px 12px;font-size:14px;cursor:pointer;display:flex;align-items:center;gap:8px}
.autocomplete-item:hover{background:var(--blue-light)}
/* Share buttons */
.share-btn{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:var(--radius-sm);border:1px solid var(--gray1);background:#fff;font-size:14px;font-weight:500;cursor:pointer;width:100%;margin-bottom:8px;color:var(--gray4)}
.share-btn:hover{background:var(--gray0)}
.share-btn .sb-ic{font-size:20px;width:24px;text-align:center;flex-shrink:0}
/* Currencies */
.currency-custom-row{display:flex;gap:8px;margin-top:8px}
/* Home-currency report summary */
.home-summary-card{background:linear-gradient(160deg,var(--blue-light) 0%,#dceaf8 55%,#eef5fc 100%);border-color:var(--blue-mid)}
.home-summary-total{font-size:28px;font-weight:700;color:var(--blue-dark);letter-spacing:-.5px;margin-top:2px}
.home-summary-total span{font-size:16px;font-weight:600;margin-left:4px}
.home-summary-warn{margin-top:10px;padding:8px 10px;border-radius:var(--radius-sm);background:var(--amber-light);color:var(--amber);font-size:12px;line-height:1.4}
/* A2HS install prompt */
.a2hs-overlay{position:fixed;inset:0;background:rgba(12,44,76,0.55);z-index:160;display:flex;align-items:flex-end;justify-content:center;animation:a2hsFade .25s ease}
.a2hs-overlay.hide{opacity:0;transition:opacity .25s ease}
.a2hs-banner{position:relative;width:100%;max-width:480px;background:#fff;border-radius:22px 22px 0 0;box-shadow:0 -12px 40px rgba(0,0,0,0.28);padding:12px 20px calc(20px + env(safe-area-inset-bottom,0px));z-index:161;transform:translateY(0);transition:transform .3s ease;max-height:90dvh;overflow-y:auto}
.a2hs-banner.hide{transform:translateY(110%)}
.a2hs-handle{width:44px;height:5px;border-radius:99px;background:var(--gray1);margin:4px auto 14px}
.a2hs-close{position:absolute;top:14px;right:14px;background:var(--gray0);border:none;border-radius:50%;width:36px;height:36px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--gray3);padding:0}
.a2hs-close .icon{width:20px;height:20px}
.a2hs-hero{display:flex;flex-direction:column;align-items:center;text-align:center;padding:8px 8px 18px;gap:10px}
.a2hs-hero img{width:72px;height:72px;border-radius:18px;box-shadow:0 8px 20px rgba(24,95,165,0.28)}
.a2hs-hero h2{font-size:22px;font-weight:700;color:var(--gray4);letter-spacing:-.3px}
.a2hs-hero p{font-size:15px;color:var(--gray3);line-height:1.45;max-width:300px}
.a2hs-steps{display:flex;flex-direction:column;gap:10px;margin-bottom:16px}
.a2hs-step{display:flex;align-items:center;gap:14px;padding:14px 14px;border-radius:14px;background:var(--blue-light);border:1px solid #c5daf0}
.a2hs-step-num{width:26px;height:26px;border-radius:50%;background:var(--blue);color:#fff;font-size:13px;font-weight:700;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.a2hs-step-ic{width:48px;height:48px;border-radius:12px;background:#fff;border:1px solid var(--gray1);display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--blue-dark);box-shadow:0 2px 6px rgba(0,0,0,0.06)}
.a2hs-step-ic svg{width:26px;height:26px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.a2hs-step-ic.ios-share{color:#378ADD}
.a2hs-step-ic.android-menu{color:var(--gray4)}
.a2hs-step-ic.add-home{color:var(--teal)}
.a2hs-step-text{flex:1;min-width:0}
.a2hs-step-text b{display:block;font-size:15px;font-weight:600;color:var(--gray4);margin-bottom:2px}
.a2hs-step-text span{font-size:13px;color:var(--gray3);line-height:1.35}
.a2hs-ic-chip{display:inline-flex;align-items:center;justify-content:center;width:1.4em;height:1.4em;vertical-align:-0.28em;margin:0 2px;border-radius:5px;background:#fff;border:1px solid var(--gray1);box-shadow:0 1px 2px rgba(0,0,0,0.06);color:var(--gray4)}
.a2hs-ic-chip svg{width:0.9em;height:0.9em;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.a2hs-ic-chip.share,.a2hs-ic-chip.more{color:#378ADD;border-color:#c5daf0;background:var(--blue-light)}
.a2hs-ic-chip.plus{color:var(--teal);border-color:#b8e0d2;background:var(--teal-light)}
.a2hs-ic-chip.menu{color:var(--gray4);background:var(--gray0)}
.a2hs-cta{width:100%;padding:14px 16px;font-size:16px;border-radius:12px}
@keyframes a2hsFade{from{opacity:0}to{opacity:1}}