:root{--bg:#f7f5f2;--surface:#fff;--surface-2:#f0ebe4;--ink:#1a1f1c;--muted:#6b736e;--border:#e4ddd4;--teal:#0d9488;--teal-dark:#0f766e;--teal-soft:#ccfbf1;--green:#16a34a;--green-soft:#dcfce7;--red:#dc2626;--red-soft:#fee2e2;--amber:#d97706;--amber-soft:#fef3c7;--shadow:0 1px 3px #1a1f1c0f, 0 4px 16px #1a1f1c0a;--radius:14px;--radius-sm:10px;--nav-h:64px;color:var(--ink);background:var(--bg);font-synthesis:none;text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;font-family:Noto Sans TC,PingFang TC,Microsoft JhengHei,system-ui,sans-serif;font-weight:400;line-height:1.5}*{box-sizing:border-box}html,body,#root{min-height:100%;margin:0}body{min-width:320px}button,input,select,textarea{font:inherit;color:inherit}button{cursor:pointer}a{color:var(--teal-dark)}.app-shell{max-width:560px;min-height:100dvh;padding-bottom:calc(var(--nav-h) + 16px);flex-direction:column;margin:0 auto;display:flex}.app-header{z-index:20;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border-bottom:1px solid var(--border);background:#f7f5f2eb;padding:14px 16px 12px;position:sticky;top:0}.app-header h1{letter-spacing:-.02em;margin:0;font-size:1.25rem;font-weight:700}.app-header .sub{color:var(--muted);margin:2px 0 0;font-size:.8rem}.main{flex-direction:column;flex:1;gap:14px;padding:16px;display:flex}.bottom-nav{height:var(--nav-h);background:var(--surface);border-top:1px solid var(--border);z-index:30;padding-bottom:env(safe-area-inset-bottom,0);justify-content:center;display:flex;position:fixed;bottom:0;left:0;right:0}.bottom-nav-inner{grid-template-columns:repeat(4,1fr);width:100%;max-width:560px;display:grid}.nav-btn{color:var(--muted);white-space:nowrap;word-break:keep-all;line-break:strict;background:0 0;border:none;flex-direction:column;justify-content:center;align-items:center;gap:2px;padding:8px 4px;font-size:.7rem;font-weight:600;display:flex}.nav-btn.active{color:var(--teal-dark)}.nav-btn .icon{font-size:1.25rem;line-height:1}.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:14px 16px}.card h2,.card h3{margin:0 0 10px;font-size:1rem}.section-title{justify-content:space-between;align-items:center;gap:8px;margin-bottom:10px;display:flex}.section-title h2{margin:0;font-size:1.05rem}.section-actions{flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:6px;min-width:0;display:flex}.btn{white-space:nowrap;word-break:keep-all;line-break:strict;border:none;border-radius:999px;flex-shrink:0;justify-content:center;align-items:center;gap:6px;padding:9px 16px;font-size:.9rem;font-weight:600;transition:background .15s,transform .1s;display:inline-flex}.btn:active{transform:scale(.98)}.btn-primary{background:var(--teal);color:#fff}.btn-primary:hover{background:var(--teal-dark)}.btn-secondary{background:var(--surface-2);color:var(--ink)}.btn-ghost{color:var(--teal-dark);background:0 0;padding:6px 10px}.btn-danger{background:var(--red-soft);color:var(--red)}.btn-sm{padding:6px 12px;font-size:.8rem}.btn-block{width:100%}.list{flex-direction:column;gap:8px;display:flex}.list-item{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);text-align:left;align-items:center;gap:12px;width:100%;padding:12px;display:flex}.list-item.clickable{cursor:pointer}.list-item.clickable:hover{border-color:var(--teal)}.avatar{background:var(--teal-soft);width:40px;height:40px;color:var(--teal-dark);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;font-size:.95rem;font-weight:700;display:flex}.avatar.sm{width:32px;height:32px;font-size:.8rem}.item-body{flex:1;min-width:0}.item-title{white-space:nowrap;text-overflow:ellipsis;font-size:.95rem;font-weight:600;overflow:hidden}.item-meta{color:var(--muted);margin-top:2px;font-size:.78rem}.item-actions{flex-wrap:wrap;flex-shrink:0;justify-content:flex-end;gap:4px;max-width:100%;display:flex}.amount{font-variant-numeric:tabular-nums;white-space:nowrap;font-weight:700}.amount.pos{color:var(--green)}.amount.neg{color:var(--red)}.amount.zero{color:var(--muted)}.empty{text-align:center;color:var(--muted);padding:28px 16px;font-size:.9rem}.empty .emoji{margin-bottom:8px;font-size:2rem}.form-stack{flex-direction:column;gap:12px;display:flex}label.field{color:var(--muted);flex-direction:column;gap:6px;font-size:.82rem;font-weight:600;display:flex}.field input,.field select,.field textarea{border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);color:var(--ink);padding:10px 12px;font-size:1rem;font-weight:500}.field input:focus,.field select:focus,.field textarea:focus{outline:2px solid var(--teal-soft);border-color:var(--teal)}.chip-row{flex-wrap:wrap;gap:8px;display:flex}.chip{border:1.5px solid var(--border);background:var(--surface);white-space:nowrap;word-break:keep-all;line-break:strict;border-radius:999px;flex-shrink:0;align-items:center;gap:6px;padding:8px 12px;font-size:.85rem;font-weight:600;display:inline-flex}.chip.selected{border-color:var(--teal);background:var(--teal-soft);color:var(--teal-dark)}.chip input{accent-color:var(--teal)}.modal-backdrop{z-index:50;background:#1a1f1c73;justify-content:center;align-items:flex-end;padding:0;display:flex;position:fixed;inset:0}@media (width>=560px){.modal-backdrop{align-items:center;padding:16px}}.modal{background:var(--surface);border-radius:18px 18px 0 0;width:100%;max-width:480px;max-height:92dvh;padding:18px 16px 24px;overflow-y:auto;box-shadow:0 -8px 40px #00000026}@media (width>=560px){.modal{border-radius:18px}}.modal-header{justify-content:space-between;align-items:center;margin-bottom:14px;display:flex}.modal-header h2{margin:0;font-size:1.15rem}.back-row{flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:4px;display:flex}.tabs{background:var(--surface-2);border-radius:999px;gap:6px;margin-bottom:4px;padding:4px;display:flex}.tab{min-width:0;color:var(--muted);white-space:nowrap;word-break:keep-all;line-break:strict;background:0 0;border:none;border-radius:999px;flex:auto;padding:8px;font-size:.85rem;font-weight:600}.tab.active{background:var(--surface);color:var(--ink);box-shadow:var(--shadow)}.balance-row{border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;padding:10px 0;display:flex}.balance-row:last-child{border-bottom:none}.suggest-card{background:var(--amber-soft);border-radius:var(--radius-sm);border:1px solid #fde68a;flex-direction:column;gap:8px;padding:12px;display:flex}.suggest-row{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px;display:flex}.badge{background:var(--surface-2);color:var(--muted);border-radius:999px;padding:2px 8px;font-size:.7rem;font-weight:700;display:inline-block}.hint{color:var(--muted);margin:0;font-size:.78rem}.error{color:var(--red);margin:0;font-size:.82rem}.custom-split-row{align-items:center;gap:10px;display:flex}.custom-split-row input{border:1px solid var(--border);border-radius:var(--radius-sm);width:110px;padding:8px 10px}.split-sum{font-size:.8rem;font-weight:600}.split-sum.ok{color:var(--green)}.split-sum.bad{color:var(--red)}.fab-area{bottom:calc(var(--nav-h) + 12px);pointer-events:none;z-index:10;justify-content:flex-end;margin-top:auto;display:flex;position:sticky}.fab-area .btn{pointer-events:auto;box-shadow:0 4px 14px #0d948859}.header-row{justify-content:space-between;align-items:flex-start;gap:12px;display:flex}.auth-shell{padding-bottom:24px}.auth-card{margin-top:8px}.row-2{grid-template-columns:1fr 1fr;gap:10px;display:grid}@media (width<=420px){.row-2{grid-template-columns:1fr}}.fab-row{flex-wrap:wrap;gap:8px;display:flex}.receipt-pick-row{flex-wrap:wrap;gap:10px;display:flex}.receipt-pick-row .btn{white-space:nowrap;word-break:keep-all;line-break:strict;flex:140px;justify-content:center}.receipt-file-input{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.receipt-preview{object-fit:contain;border-radius:var(--radius-sm);background:var(--surface-2);border:1px solid var(--border);width:100%;max-height:140px;display:block}.receipt-preview-hit{cursor:zoom-in;border-radius:var(--radius-sm);background:0 0;border:none;width:100%;margin:0;padding:0;line-height:0;display:block}.receipt-preview-hit:focus-visible{outline:2px solid var(--teal);outline-offset:2px}.receipt-preview-hit .receipt-preview{pointer-events:none}.receipt-preview-thumb{object-fit:cover;background:var(--surface-2);border:1px solid var(--border);border-radius:8px;flex-shrink:0;width:44px;height:44px;max-height:none;display:block}.receipt-preview-hit.thumb{flex-shrink:0;width:auto}.image-lightbox-backdrop{z-index:80;box-sizing:border-box;background:#0a0c0be0;justify-content:center;align-items:center;padding:48px 12px 16px;display:flex;position:fixed;inset:0}.image-lightbox-close{top:max(10px, env(safe-area-inset-top,0px));right:max(10px, env(safe-area-inset-right,0px));z-index:81;color:#fff;cursor:pointer;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);background:#ffffff24;border:none;border-radius:999px;justify-content:center;align-items:center;width:40px;height:40px;font-size:1.15rem;line-height:1;display:flex;position:fixed}.image-lightbox-close:hover,.image-lightbox-close:active{background:#ffffff47}.image-lightbox-frame{-webkit-overflow-scrolling:touch;border-radius:var(--radius-sm);overscroll-behavior:contain;max-width:min(100%,920px);max-height:100%;overflow:auto}.image-lightbox-img{border-radius:var(--radius-sm);background:var(--surface-2);max-width:100%;height:auto;margin:0 auto;display:block}.receipt-items-section{flex-direction:column;gap:10px;min-width:0;display:flex}.receipt-items-section>.section-title{margin-bottom:0}.receipt-items-section>.section-title h3{color:var(--ink);margin:0;font-size:1rem;font-weight:700}.receipt-items-list{overscroll-behavior:contain;-webkit-overflow-scrolling:touch;flex-direction:column;gap:10px;max-height:min(42dvh,360px);margin:0 -2px;padding:2px 2px 4px;display:flex;overflow-y:auto}.receipt-item-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);flex-direction:column;gap:10px;min-width:0;padding:12px 12px 14px;display:flex}.receipt-item-top{align-items:flex-end;gap:8px;min-width:0;display:flex}.receipt-item-name{flex:1;gap:4px;min-width:0}.receipt-item-name input{min-height:46px;padding:12px;font-size:1.05rem;font-weight:600}.receipt-item-amount{flex:none;gap:4px;width:108px}.receipt-item-amount .amount-input-wrap{border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);align-items:center;gap:4px;min-height:46px;padding:0 10px;display:flex}.receipt-item-amount .amount-input-wrap:focus-within{outline:2px solid var(--teal-soft);border-color:var(--teal)}.receipt-item-amount .amount-prefix{color:var(--muted);flex-shrink:0;font-size:.9rem;font-weight:700}.receipt-item-amount input{text-align:right;font-variant-numeric:tabular-nums;background:0 0;border:none;width:100%;min-width:0;min-height:0;padding:10px 0;font-size:1.05rem;font-weight:700}.receipt-item-amount input:focus{border:none;outline:none}.receipt-item-amount input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.receipt-item-amount input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.receipt-item-amount input[type=number]{appearance:textfield}.receipt-item-remove{border-radius:var(--radius-sm);background:var(--red-soft);width:44px;height:46px;color:var(--red);border:none;flex-shrink:0;justify-content:center;align-items:center;padding:0;font-size:1.35rem;font-weight:700;line-height:1;display:inline-flex}.receipt-item-remove:active{transform:scale(.96)}.receipt-item-remove:disabled{opacity:.4;cursor:not-allowed}.receipt-item-split-label{color:var(--muted);margin:0;font-size:.78rem;font-weight:600}.receipt-item-chips{gap:8px}.receipt-item-chips .chip{gap:8px;min-height:44px;padding:10px 14px;font-size:.88rem}.receipt-item-chips .chip input{flex-shrink:0;width:18px;height:18px}.receipt-item-chips .avatar.sm{width:28px;height:28px;font-size:.75rem}.receipt-items-total{background:var(--teal-soft);border-radius:var(--radius-sm);border:1px solid #99f6e4;justify-content:space-between;align-items:center;gap:12px;padding:12px 14px;font-size:.95rem;display:flex}.receipt-items-total .label{color:var(--teal-dark);font-weight:600}.receipt-items-total .value{font-variant-numeric:tabular-nums;color:var(--teal-dark);font-size:1.1rem;font-weight:800}.receipt-items-add{border:1.5px dashed var(--border);background:var(--surface-2);width:100%;min-height:44px;color:var(--teal-dark);border-radius:var(--radius-sm);font-size:.9rem;font-weight:700}.receipt-items-add:active{transform:scale(.99)}.receipt-items-empty{text-align:center;background:var(--surface-2);border-radius:var(--radius-sm);color:var(--muted);margin:0;padding:14px;font-size:.85rem}.receipt-edit{max-height:none;overflow:visible}@media (width<=420px){.receipt-item-amount{width:96px}.receipt-item-remove{width:42px}}.filter-bar .field{margin-bottom:0}.detail-list{flex-direction:column;gap:6px;margin:8px 0 0;padding:0;list-style:none;display:flex}.detail-list li{background:var(--surface-2);border-radius:var(--radius-sm);justify-content:space-between;gap:12px;padding:8px 10px;font-size:.9rem;display:flex}.list-item[role=button]{cursor:pointer}.overall-balance-card{margin-bottom:0;padding:14px 14px 10px}.overall-balance-title{margin-bottom:10px;font-size:.95rem;font-weight:700}.overall-balance-block+.overall-balance-block{border-top:1px solid var(--border);margin-top:12px;padding-top:12px}.overall-balance-currency{color:var(--muted);margin-bottom:8px;font-size:.8rem;font-weight:600}.overall-balance-grid{grid-template-columns:1fr 1fr;gap:10px;display:grid}.overall-balance-cell,.overall-balance-net{flex-direction:column;gap:2px;min-width:0;display:flex}.overall-balance-cell .amount,.overall-balance-net .amount{word-break:break-word;font-size:1.05rem;font-weight:700}.overall-balance-label{color:var(--muted);font-size:.75rem;font-weight:600}.overall-balance-net{border-top:1px dashed var(--border);flex-direction:row;justify-content:space-between;align-items:center;margin-top:10px;padding-top:10px}.overall-balance-hint{margin:10px 0 0;font-size:.75rem}.overall-balance-settled .overall-balance-title{margin-bottom:6px}.modal.modal--large{width:100%;max-width:min(960px,100%);height:100dvh;max-height:100dvh;box-shadow:none;border-radius:0;flex-direction:column;padding:14px 14px 18px;display:flex}@media (width>=560px){.modal.modal--large{border-radius:18px;height:min(92dvh,900px);max-height:92dvh;box-shadow:0 12px 48px #0003}}.modal.modal--large .modal-header{flex-shrink:0}.admin-users-modal{flex-direction:column;flex:1;gap:10px;min-height:0;display:flex;overflow:hidden}.admin-users-search,.admin-users-count{flex-shrink:0;margin:0}.admin-users-wrap{-webkit-overflow-scrolling:touch;border:1px solid var(--border);border-radius:12px;flex:1;min-height:0;margin-top:0;overflow:auto}.admin-users-table{border-collapse:collapse;width:100%;font-size:.82rem}.admin-users-table th,.admin-users-table td{text-align:left;border-bottom:1px solid var(--border);vertical-align:top;word-break:break-word;padding:8px 10px}.admin-users-table thead th{background:var(--surface);z-index:1;position:sticky;top:0}.admin-users-table th{color:var(--muted);white-space:nowrap;font-weight:600}.admin-users-table tbody tr:last-child td{border-bottom:none}
