:root{font-family:-apple-system,BlinkMacSystemFont,"PingFang TC","Noto Sans TC",sans-serif;color:#213e35;background:#e9ece5;font-synthesis:none;--ink:#213e35;--muted:#64756d;--accent:#205747;--tint:#e7eee2;--line:#dce3d9;--paper:#f6f5ef;--warm:#f3e7cf;--red:#a13830;color-scheme:light}
*{box-sizing:border-box}body{margin:0}button,input,textarea{font:inherit}button,a,input,textarea{-webkit-tap-highlight-color:transparent}button{cursor:pointer;color:inherit}button:disabled{opacity:.5;cursor:default}button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible{outline:3px solid #b47829;outline-offset:3px}button{min-height:44px}a{color:var(--accent)}h1,h2,h3,p{margin:0}h1{font-size:27px;font-weight:650;letter-spacing:-.8px;line-height:1.35}h2{font-size:21px;line-height:1.4;letter-spacing:-.4px}h3{font-size:16px;font-weight:600;line-height:1.5}small{font-size:12px}svg{width:21px;height:21px;flex-shrink:0;stroke:currentColor;stroke-width:1.7;fill:none;stroke-linecap:round;stroke-linejoin:round}button svg{pointer-events:none}#app{max-width:480px;min-height:100dvh;background:var(--paper);margin:auto;padding-bottom:calc(92px + env(safe-area-inset-bottom));box-shadow:0 0 60px #233c3610}.topbar{display:flex;align-items:center;justify-content:space-between;padding:calc(22px + env(safe-area-inset-top)) 24px 12px;background:var(--tint)}.brand{display:flex;align-items:center;gap:9px;font-size:20px;font-weight:650;letter-spacing:1px}.brand svg{width:27px;height:27px}.brand small{display:block;font-size:8px;letter-spacing:1.9px;margin-top:1px;font-weight:500}.icon-button{border:1px solid var(--line);border-radius:50%;background:#ffffff70;width:44px;display:inline-flex;align-items:center;justify-content:center}.trip-block{background:var(--tint);padding:15px 24px 25px}.eyebrow{font-size:10px;letter-spacing:2px;font-weight:600;color:var(--muted);text-transform:uppercase}.trip-switch{width:100%;display:flex;align-items:center;justify-content:space-between;text-align:left;border:0;background:none;padding:0;gap:14px}.trip-switch h1{margin:8px 0 7px;overflow-wrap:anywhere}.trip-switch .round{width:36px;height:36px;border:1px solid #b7c8bb;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0}.sub{font-size:12px;color:var(--muted);line-height:1.65}.connection{display:flex;align-items:center;gap:6px;margin-top:16px;font-size:11px;color:#45694f}.dot{width:6px;height:6px;background:#527c57;border-radius:50%}.offline .dot{background:#a8782e}.main{padding:26px 20px}.section-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:18px}.section-head .sub{margin-top:5px}.button{border:0;border-radius:13px;padding:11px 16px;min-height:46px;display:inline-flex;align-items:center;justify-content:center;gap:7px;font-weight:600;font-size:14px}.primary{background:var(--accent);color:#fff}.secondary{background:var(--tint);color:var(--accent)}.quiet{border:1px solid var(--line);background:transparent;font-weight:500}.danger{color:var(--red);background:#f8ebe7}.wide{width:100%}.filters{display:flex;gap:7px;overflow:auto;padding:0 0 7px;margin-bottom:14px;scrollbar-width:none}.chip{border:1px solid var(--line);border-radius:30px;white-space:nowrap;background:transparent;padding:8px 15px;font-size:12px;min-height:40px}.chip[aria-pressed=true]{background:var(--ink);color:white;border-color:var(--ink)}.card{background:#fff;border:1px solid var(--line);border-radius:18px;padding:17px;margin-bottom:12px}.item-top{display:flex;gap:14px}.thumb{display:flex;align-items:center;justify-content:center;background:#eef0e8;border-radius:13px;width:68px;height:78px;flex-shrink:0;border:0;overflow:hidden;color:#719078}.thumb svg{width:26px;height:26px}.thumb img{width:100%;height:100%;object-fit:cover}.item-info{flex:1;min-width:0;overflow-wrap:anywhere}.tag{display:inline-block;font-size:10px;padding:3px 7px;border-radius:5px;background:var(--tint);margin-bottom:6px}.tag.proxy{background:var(--warm);color:#80612f}.item-info .sub{margin-top:4px}.item-footer{border-top:1px solid #edf0e9;display:flex;align-items:center;justify-content:space-between;gap:10px;padding-top:12px;margin-top:14px}.progress{font-size:12px;color:var(--muted)}.progress strong{font-size:15px;color:var(--ink)}.text-button{border:0;background:transparent;padding:7px 9px;font-size:12px;color:var(--muted)}.actions{display:flex;gap:7px;align-items:center}.item-footer .button{font-size:12px;min-height:40px;padding:9px 12px}.done{opacity:.72}.note{background:var(--tint);border-radius:12px;padding:13px 14px;color:#49624f;font-size:12px;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere}.note.warm{background:var(--warm);color:#755c35}.note a{font-weight:600}.empty{padding:34px 12px;text-align:center;color:var(--muted)}.empty svg{width:45px;height:45px;margin-bottom:14px;color:#8d9d85}.empty h3{color:var(--ink);margin-bottom:7px}.empty p{font-size:13px;line-height:1.9;margin-bottom:20px}.intro{padding:24px 10px;text-align:center}.intro .luggage{width:132px;height:132px;margin:4px auto 24px;display:block}.intro h1{font-size:29px}.intro p{margin:14px 0 27px;color:var(--muted);line-height:1.9;font-size:14px}.intro-points{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:32px 0}.intro-points span{display:flex;flex-direction:column;align-items:center;gap:9px;font-size:11px;color:var(--muted)}.bottom-nav{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:min(480px,100%);background:#fcfcf7f5;backdrop-filter:blur(14px);border-top:1px solid var(--line);padding:9px 18px calc(9px + env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(3,1fr);gap:8px;z-index:5}.bottom-nav button{border:0;background:none;color:#7d897e;display:flex;flex-direction:column;gap:4px;align-items:center;padding:7px;border-radius:12px;font-size:11px;min-height:54px}.bottom-nav button[aria-current=page]{background:var(--tint);color:var(--accent);font-weight:600}.bottom-nav svg{width:23px;height:23px}.hero{background:var(--accent);color:#fff;padding:23px;border-radius:20px;margin-bottom:14px;position:relative;overflow:hidden}.hero:after{content:'';width:110px;height:110px;border:1px solid #ffffff20;position:absolute;border-radius:50%;right:-35px;top:-15px;box-shadow:0 0 0 20px #ffffff08,0 0 0 40px #ffffff06}.hero small{color:#d1e4d6}.hero-amount{font-size:33px;letter-spacing:-1px;font-weight:550;margin:9px 0;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.stat-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:20px}.stat{background:#fff;border:1px solid var(--line);border-radius:15px;padding:15px;min-width:0}.stat b{display:block;margin-top:8px;font-size:18px;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}.group-heading{font-size:13px;color:var(--muted);margin:25px 0 12px;display:flex;justify-content:space-between}.row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 0;border-bottom:1px solid var(--line)}.row:last-child{border-bottom:0}.row>div{min-width:0;overflow-wrap:anywhere}.row .value{text-align:right;flex-shrink:0;font-size:14px;font-variant-numeric:tabular-nums}.transaction{display:flex;align-items:center;width:100%;border:0;background:none;text-align:left;padding:16px 0;border-bottom:1px solid var(--line);gap:12px}.transaction .tx-symbol{width:39px;height:42px;border-radius:12px;display:flex;align-items:center;justify-content:center;background:var(--tint);flex-shrink:0}.transaction .tx-text{flex:1;min-width:0;overflow-wrap:anywhere}.transaction strong{font-size:14px;font-weight:550}.transaction .value{font-size:15px;text-align:right;max-width:43%;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}.status{font-size:10px;display:inline-block;padding:2px 5px;border-radius:5px;margin-top:4px;background:var(--warm);color:#8b6632}.status.settled{background:var(--tint);color:#527158}.split-row{background:#fff;border:1px solid var(--line);border-radius:14px;padding:14px;margin-bottom:10px}.split-row .row{padding:0;border:0}.split-row p{margin-top:5px}.split-row .button{font-size:12px;padding:8px 12px}.fine{font-size:11px;color:var(--muted);line-height:1.8;margin-top:15px}.section-actions{display:flex;gap:8px;margin-top:12px}.section-actions>*{flex:1}.loading{padding:80px 20px;text-align:center}dialog{border:0;padding:0;border-radius:24px 24px 0 0;background:var(--paper);color:var(--ink);width:min(480px,100%);max-width:100%;max-height:92dvh;position:fixed;top:auto;bottom:0;margin:0 auto;box-shadow:0 -16px 70px #122b2525;overscroll-behavior:contain}dialog::backdrop{background:#172e285e;backdrop-filter:blur(3px)}.sheet-head{padding:19px 22px 13px;display:flex;align-items:center;justify-content:space-between;gap:12px;position:sticky;top:0;background:var(--paper);z-index:2;border-bottom:1px solid var(--line)}.sheet-head h2{font-size:20px}.sheet-body{padding:20px 22px calc(24px + env(safe-area-inset-bottom))}.sheet-head .text-button{font-size:13px}.sheet-option{display:flex;align-items:center;width:100%;padding:14px;border:1px solid var(--line);border-radius:14px;background:#fff;text-align:left;gap:12px;margin:8px 0;min-height:62px}.sheet-option[aria-pressed=true]{border-color:#668d70;background:var(--tint)}.sheet-option .option-symbol{width:35px;height:35px;display:flex;align-items:center;justify-content:center;background:var(--tint);border-radius:10px;flex-shrink:0;font-size:13px}.sheet-option .option-text{flex:1;min-width:0;overflow-wrap:anywhere}.sheet-option strong{font-size:14px}.sheet-option small{display:block;color:var(--muted);margin-top:4px;font-size:11px}.form{display:grid;gap:17px}.form label,.field{display:grid;gap:7px;font-size:12px;color:var(--muted);min-width:0}.form input:not([type=checkbox]):not([type=file]),.form textarea{border:1px solid var(--line);background:#fff;border-radius:11px;min-height:48px;width:100%;padding:12px;color:var(--ink);font-size:16px;min-width:0}.form input[type=hidden]{display:none}.form textarea{resize:vertical;min-height:86px;line-height:1.5}.form input[type=file]{font-size:12px}.form input[type=date]{display:block;appearance:none;-webkit-appearance:none;min-width:0;max-width:100%;height:48px}.pair{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px}.field-trigger{border:1px solid var(--line);background:#fff;border-radius:11px;min-height:48px;padding:11px 12px;text-align:left;display:flex;align-items:center;justify-content:space-between;width:100%;font-size:14px;gap:8px}.field-trigger span{overflow-wrap:anywhere}.field-trigger svg{width:16px}.checks{display:flex;gap:8px;flex-wrap:wrap}.checks label{display:flex;align-items:center;gap:7px;min-height:44px;border:1px solid var(--line);border-radius:11px;padding:9px 12px;background:white;color:var(--ink)}.checks label:has(input:checked){background:var(--tint);border-color:#799a7a}.checks input{accent-color:var(--accent);width:17px;height:17px}.member-row{display:flex;gap:8px;margin-top:8px}.member-row input{flex:1}.member-row button{flex-shrink:0}.error{color:var(--red);font-size:13px;line-height:1.7;white-space:pre-wrap}.error:empty{display:none}.sheet-footer{flex:0 0 auto;background:var(--paper);padding:12px 22px calc(18px + env(safe-area-inset-bottom));border-top:1px solid var(--line)}.sheet-footer .button{min-height:51px}.photo-preview{width:100%;height:150px;object-fit:contain;border:1px solid var(--line);border-radius:12px;background:#fff}.photo-full{display:block;max-width:100%;max-height:64dvh;object-fit:contain;margin:auto}.storage-line{height:5px;background:#e0e6dc;border-radius:8px;margin-top:12px;overflow:hidden}.storage-line progress{width:100%;height:5px;display:block;accent-color:var(--accent)}.settings-section{margin-bottom:24px}.settings-section h3{margin-bottom:11px}.settings-section p{font-size:12px;line-height:1.9;color:var(--muted)}#toast{position:fixed;bottom:calc(91px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100% - 32px);padding:13px 18px;border-radius:13px;background:#213e35;color:white;box-shadow:0 6px 25px #183d2b25;z-index:20;font-size:13px;pointer-events:none;opacity:0;transition:opacity .15s}#toast.visible{opacity:1}.notice-bar{background:var(--warm);padding:10px 20px;font-size:12px;line-height:1.7}.notice-bar button{background:none;border:0;text-decoration:underline;padding:0 5px;min-height:30px}.spacer{height:10px}[hidden]{display:none!important}details summary{cursor:pointer;min-height:44px;display:flex;align-items:center;font-size:12px;color:var(--muted)}details summary:before{content:'＋';margin-right:6px}details[open] summary:before{content:'−'}details .note{margin-bottom:10px}.divider{border:0;border-top:1px solid var(--line);margin:20px 0}.tabular{font-variant-numeric:tabular-nums}@media(min-width:600px){#app{border-left:1px solid var(--line);border-right:1px solid var(--line)}dialog{bottom:20px;border-radius:24px;max-height:90dvh}.bottom-nav{border-radius:18px 18px 0 0}}@media(max-width:360px){.main{padding:22px 14px}.topbar,.trip-block{padding-left:18px;padding-right:18px}.sheet-body{padding-left:16px;padding-right:16px}.sheet-head{padding-left:16px;padding-right:16px}h1{font-size:24px}.button{padding:10px 12px}.thumb{width:56px;height:68px}.hero-amount{font-size:28px}.stat b{font-size:16px}}

/* The dialog owns the rounded outline; only its inset body scrolls. */
dialog{overflow:hidden}
dialog[open]{display:flex;flex-direction:column}
body:has(dialog[open]){overflow:hidden}
.sheet-head{position:relative;flex:0 0 auto}
.sheet-head .text-button{border-radius:12px;outline-offset:1px}
.sheet-body{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;margin:0 6px 6px 0;padding-right:16px;scrollbar-width:thin;scrollbar-color:#aebfb2 transparent;scroll-padding-block:16px 84px}
.sheet-body::-webkit-scrollbar{width:6px}
.sheet-body::-webkit-scrollbar-track{background:transparent}
.sheet-body::-webkit-scrollbar-thumb{background:#aebfb2;border-radius:8px}
/* Keep the native file picker accessible, with a full-card touch target. */
.file-upload,.form .file-upload{position:relative;display:flex;align-items:center;gap:13px;width:100%;min-height:94px;padding:17px 16px;border:1px dashed #9caf9c;border-radius:16px;background:#fff;cursor:pointer;isolation:isolate;text-align:left;color:var(--ink)}
.file-upload:hover{background:#f2f6ef;border-color:#638a6e}
.file-upload:has(.file-input:focus-visible){outline:3px solid #b47829;outline-offset:3px}
.file-upload:has(.file-input:disabled){opacity:.6;cursor:wait}
.file-upload .file-input{position:absolute;inset:0;z-index:1;width:100%;height:100%;margin:0;padding:0;opacity:0;cursor:pointer;border:0;font-size:16px}
.upload-icon{width:46px;height:46px;display:flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:14px;background:var(--tint);color:var(--accent)}
.upload-icon svg{width:24px;height:24px}
.upload-copy{display:grid;gap:5px;min-width:0;flex:1;line-height:1.5}
.upload-copy strong{font-size:14px;font-weight:600}
.upload-copy>span{font-size:12px;color:var(--muted);overflow-wrap:anywhere}
.upload-plus{font-size:20px;color:var(--accent);flex-shrink:0}
.photo-format-note{font-size:11px;line-height:1.6;color:var(--muted)}
.file-upload.backup-file{margin-top:4px}
@media(max-width:360px){.sheet-body{padding-right:10px}.file-upload,.form .file-upload{padding:14px 12px;gap:10px}.upload-icon{width:40px;height:40px}}

/* Member controls share one action column; the identity badge stays compact. */
.member-row{display:grid;grid-template-columns:minmax(0,1fr) 48px;align-items:center}
.member-row .tag{justify-self:center;margin:0;padding:4px 9px;border-radius:8px;font-size:11px;line-height:1.5;white-space:nowrap}
.member-row .text-button{width:48px;min-height:44px;padding:7px 0}

/* Keep record titles and amounts separate from their secondary information. */
.transaction .tx-text{display:flex;flex-direction:column;align-items:flex-start;gap:4px}
.transaction .tx-text strong{display:block;max-width:100%;line-height:1.5}
.transaction .sub{display:block}
.transaction .value{min-width:0;flex-shrink:0;line-height:1.5}
.transaction .value>.sub{margin-top:4px}
.transaction .tx-text .status{margin-top:0}

/* Keep currency text and its chevron on one baseline, including focus rings. */
.currency-button{display:inline-flex;align-items:center;justify-content:center;gap:5px;flex:0 0 auto;white-space:nowrap;border:1px solid var(--line);border-radius:12px;min-width:78px;min-height:44px;padding:9px 10px;line-height:1.2;outline-offset:2px}
.currency-button svg{display:block;width:16px;height:16px}
.section-head>div{min-width:0}
.section-head>.button{flex-shrink:0;white-space:nowrap}
.ledger-fund-actions{display:flex;flex-wrap:wrap;gap:8px;margin:-3px 0 18px}
.ledger-fund-actions .button{flex:1 1 110px;font-size:12px;min-height:44px;padding:9px 10px;white-space:nowrap}
.settlement-section{margin:18px 0 24px}
.settlement-totals{margin:5px 0 12px;overflow-wrap:anywhere}
.settlement-group{padding:16px;background:#fff;border:1px solid var(--line);border-radius:16px;margin-bottom:12px}
.settlement-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.settlement-heading>div{min-width:0;overflow-wrap:anywhere}
.settlement-heading h3{font-size:16px}
.settlement-amount{max-width:50%;text-align:right;font-variant-numeric:tabular-nums}
.settlement-amount small{display:block;color:var(--muted);margin-bottom:5px}
.settlement-amount strong{display:block;font-size:18px;line-height:1.45;overflow-wrap:anywhere}
.settlement-group details{margin-top:6px}
.settlement-group .split-row{border-radius:10px;background:var(--paper);margin-top:8px;padding:12px}
.settlement-group .split-row .button{flex-shrink:0;white-space:nowrap}
.settlement-preview .row>div:last-child{max-width:48%;text-align:right;font-variant-numeric:tabular-nums}
.form .checks label{overflow-wrap:anywhere}
.form .checks input{flex-shrink:0}
