:root{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--ink:#17342d;--muted:#64766f;--accent:#a8ef76;--accent-strong:#88d957;--background:#f3f2ec;--surface:#fff;--warning:#fff3cb;--warning-ink:#735300;--error:#a82424;--radius-large:22px;--radius-medium:16px;--shadow:0 10px 28px #17342d12}*,:before,:after{box-sizing:border-box;-webkit-tap-highlight-color:transparent;margin:0}[hidden]{display:none!important}html{background:var(--background);min-height:100%}body{background:var(--background);max-width:520px;min-height:100%;color:var(--ink);margin:0 auto;font-family:-apple-system,BlinkMacSystemFont,PingFang TC,Noto Sans TC,Helvetica Neue,sans-serif;font-size:16px;line-height:1.45;overflow-x:hidden}button,input{font:inherit}button{color:inherit;cursor:pointer;touch-action:manipulation}#app{min-height:100dvh;padding:calc(20px + env(safe-area-inset-top,0px)) 16px 0;flex-direction:column;display:flex}h2{margin-bottom:10px;font-size:16px;font-weight:750}h2 span{color:var(--muted);font-size:14px;font-weight:500}h3{color:var(--muted);letter-spacing:.04em;margin:0 2px 7px;font-size:12px;font-weight:700}#schema-banner{border-radius:var(--radius-medium);background:var(--warning);color:var(--warning-ink);margin-bottom:12px;padding:11px 14px;font-size:14px;font-weight:650}.segmented{border-radius:var(--radius-large);background:var(--surface);box-shadow:var(--shadow);grid-template-columns:repeat(3,1fr);gap:5px;margin-bottom:12px;padding:5px;display:grid}.segmented button{background:0 0;border:0;border-radius:17px;min-height:48px;font-weight:650}.segmented button.selected{background:var(--ink);color:var(--accent)}#view-switch{grid-template-columns:repeat(3,1fr)}#amount-section,.form-section{border-radius:var(--radius-large);background:var(--surface);box-shadow:var(--shadow);margin-bottom:12px;padding:16px}.section-heading{justify-content:space-between;align-items:center;display:flex}#currency-chip{background:var(--ink);color:var(--accent);letter-spacing:.05em;border-radius:999px;padding:6px 11px;font-size:13px;font-weight:800}#amount-display{font-variant-numeric:tabular-nums;letter-spacing:-.06em;text-overflow:ellipsis;white-space:nowrap;min-height:70px;padding:2px 0 8px;font-size:clamp(50px,16vw,76px);font-weight:850;line-height:.95;display:block;overflow:hidden}#keypad{grid-template-columns:repeat(3,1fr);gap:7px;display:grid}#keypad button{background:var(--background);border:0;border-radius:14px;min-height:52px;font-size:22px;font-weight:700}#keypad button:active,.option-grid button:active{transform:scale(.97)}.grouped-picker{gap:12px;display:grid}.option-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;display:grid}.option-grid.compact{grid-template-columns:repeat(3,minmax(0,1fr));margin-bottom:12px}.option-grid button{background:var(--surface);text-overflow:ellipsis;border:1px solid #dfe5e1;border-radius:14px;min-height:48px;padding:8px 10px;font-size:14px;font-weight:620;overflow:hidden}.option-grid button.selected{border-color:var(--accent-strong);background:var(--accent);font-weight:780}.text-field{gap:6px;display:grid}.text-field+.text-field{margin-top:12px}.text-field>span{color:var(--muted);font-size:13px;font-weight:650}.text-field.required>span{color:var(--ink)}.text-field input{background:var(--background);width:100%;min-height:50px;color:var(--ink);-webkit-appearance:none;border:1px solid #dfe5e1;border-radius:14px;outline:none;padding:0 14px;font-size:16px}.text-field input:focus{border-color:var(--accent-strong);box-shadow:0 0 0 3px #88d95733}#status-message{min-height:22px;color:var(--error);padding:0 4px 4px;font-size:14px}#submit-bar{z-index:10;padding:10px 16px calc(12px + env(safe-area-inset-bottom,0px));background:linear-gradient(transparent, var(--background) 18%);margin:0 -16px;position:sticky;bottom:0}#submit-btn{border-radius:var(--radius-large);background:var(--ink);width:100%;min-height:58px;color:var(--accent);border:0;font-size:18px;font-weight:800;box-shadow:0 10px 24px #17342d33}#submit-btn:disabled{cursor:default;opacity:.35}.recent-panel,.receivables-panel{padding-bottom:calc(24px + env(safe-area-inset-bottom,0px))}.recent-toolbar{justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px;display:flex}.recent-toolbar h2{margin:0}.recent-toolbar button{background:var(--surface);border:1px solid #dfe5e1;border-radius:14px;min-height:44px;padding:0 14px;font-size:14px;font-weight:700}.recent-toolbar button:disabled{opacity:.5}#recent-status,#receivables-status{min-height:24px;color:var(--muted);font-size:14px}#transaction-list,#receivables-list{gap:10px;display:grid}.transaction-row{border-radius:var(--radius-large);background:var(--surface);box-shadow:var(--shadow);padding:15px}.transaction-heading,.transaction-body,.transaction-details{justify-content:space-between;align-items:baseline;gap:12px;display:flex}.transaction-date,.transaction-type,.transaction-accounts,.transaction-details{color:var(--muted);font-size:13px}.transaction-type,.transaction-status{font-weight:750}.transaction-body{margin-top:8px}.transaction-description{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:17px;font-weight:750;overflow:hidden}.transaction-amount{font-variant-numeric:tabular-nums;flex:none;font-size:17px;font-weight:800}.transaction-accounts{margin-top:4px}.transaction-details{min-height:19px;margin-top:8px}.transaction-status:not(:empty){background:var(--warning);color:var(--warning-ink);border-radius:999px;padding:2px 8px}.reverse-button{background:var(--surface);width:100%;min-height:44px;color:var(--ink);border:1px solid #dfe5e1;border-radius:14px;margin-top:12px;font-weight:750}.receivable-group{gap:8px;display:grid}.receivable-group+.receivable-group{margin-top:16px}.receivable-group>h3{color:var(--ink);margin:0 4px;font-size:17px}.receivable-entry{border-radius:var(--radius-large);background:var(--surface);box-shadow:var(--shadow);grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px 12px;padding:15px;display:grid}.receivable-summary,.receivable-balance{gap:4px;display:grid}.receivable-direction{background:var(--warning);width:max-content;color:var(--warning-ink);border-radius:999px;padding:2px 8px;font-size:12px;font-weight:800}.receivable-direction.應收{background:var(--accent);color:var(--ink)}.receivable-description{text-overflow:ellipsis;white-space:nowrap;font-weight:750;overflow:hidden}.receivable-balance{grid-column:1}.receivable-balance strong{font-variant-numeric:tabular-nums;font-size:18px}.receivable-balance span{color:var(--muted);font-size:12px}.settle-button{background:var(--ink);min-width:68px;min-height:48px;color:var(--accent);border:0;border-radius:14px;grid-area:1/2/span 2;font-weight:800}.settle-confirmation{z-index:150;padding:16px;padding-bottom:calc(16px + env(safe-area-inset-bottom,0px));background:#17342d73;align-items:end;display:grid;position:fixed;inset:0}.settle-card{border-radius:var(--radius-large);background:var(--surface);width:min(100%,488px);margin:0 auto;padding:20px;box-shadow:0 20px 50px #17342d47}#settle-target,#reverse-target{margin-bottom:8px;font-weight:750}.irreversible-warning{background:var(--warning);color:var(--warning-ink);border-radius:12px;margin-bottom:16px;padding:11px 13px;font-size:14px;font-weight:700}.settle-card select{background:var(--background);width:100%;min-height:50px;color:var(--ink);border:1px solid #dfe5e1;border-radius:14px;padding:0 14px}#settle-status{min-height:22px;color:var(--error);margin-top:10px;font-size:14px}.settle-actions{grid-template-columns:1fr 2fr;gap:8px;display:grid}.settle-actions button{background:var(--background);border:0;border-radius:14px;min-height:52px;font-weight:750}.settle-actions #confirm-settle{background:var(--ink);color:var(--accent)}.settle-actions button:disabled{opacity:.5}.flash-overlay{z-index:100;background:var(--accent);color:var(--ink);pointer-events:none;place-items:center;font-size:30px;font-weight:850;animation:.7s forwards flash-out;display:grid;position:fixed;inset:0}@keyframes flash-out{0%,55%{opacity:1}to{opacity:0}}.reauth-prompt{border-radius:var(--radius-medium);background:var(--ink);color:var(--surface);margin-bottom:12px;padding:12px 14px;font-weight:650;display:block}.reauth-row{justify-content:space-between;align-items:center;gap:12px;display:flex}.reauth-prompt button{background:var(--accent);min-height:48px;color:var(--ink);border:0;border-radius:14px;padding:0 18px;font-weight:800}@media (min-width:420px){#app{padding-left:22px;padding-right:22px}.option-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}#entry-view{flex-direction:column;flex:1;min-height:0;display:flex}.step-panel{min-height:0;display:none}#entry-view[data-active-step=amount] .step-panel[data-step=amount],#entry-view[data-active-step=account] .step-panel[data-step=account],#entry-view[data-active-step=toAccount] .step-panel[data-step=toAccount],#entry-view[data-active-step=category] .step-panel[data-step=category],#entry-view[data-active-step=counterparty] .step-panel[data-step=counterparty],#entry-view[data-active-step=details] .step-panel[data-step=details],#entry-view[data-active-step=confirm] .step-panel[data-step=confirm]{flex-direction:column;flex:1;height:100%;min-height:0;animation:.2s ease-out step-in;display:flex}.step-panel>.step-question{flex:none;margin:0 2px 10px}.step-question{letter-spacing:-.03em;font-size:clamp(24px,6.5vw,32px);font-weight:800;line-height:1.15}.step-panel[data-step=amount] #amount-section .section-heading{flex:none;margin:0 2px 10px}.step-panel[data-step=amount] #amount-section .step-question{margin-bottom:0}.step-content{flex-direction:column;flex:1;min-height:0;display:flex;overflow-y:auto}.step-panel[data-step=account] .step-content>.form-section,.step-panel[data-step=toAccount] .step-content>.form-section,.step-panel[data-step=category] .step-content>.form-section,.step-panel[data-step=counterparty] #counterparty-section,.step-panel[data-step=details] .form-section,.step-panel[data-step=amount] #type-toggle{margin-top:auto}#app.keyboard-open .step-panel[data-step=account] .step-content>.form-section,#app.keyboard-open .step-panel[data-step=toAccount] .step-content>.form-section,#app.keyboard-open .step-panel[data-step=category] .step-content>.form-section,#app.keyboard-open .step-panel[data-step=counterparty] #counterparty-section,#app.keyboard-open .step-panel[data-step=details] .form-section,#app.keyboard-open .step-panel[data-step=amount] #type-toggle,#app.keyboard-open .step-panel[data-step=confirm] #confirm-card{margin-top:0}.step-panel[data-step=account] .step-content,.step-panel[data-step=toAccount] .step-content,.step-panel[data-step=category] .step-content{padding-bottom:calc(8px + env(safe-area-inset-bottom,0px))}.amount-step-content{flex-direction:column;display:flex}.step-panel .form-section,.step-panel #amount-section{margin-bottom:0}.step-action{padding:10px 0 calc(12px + env(safe-area-inset-bottom,0px));flex:none}.step-next{border-radius:var(--radius-large);background:var(--ink);width:100%;min-height:58px;color:var(--accent);border:0;font-size:18px;font-weight:800;box-shadow:0 10px 24px #17342d33}.step-next:disabled{cursor:default;opacity:.35}.step-back{min-height:44px;color:var(--muted);background:0 0;border:0;align-self:flex-start;padding:0 4px;font-weight:700}.step-panel #submit-bar{padding:10px 0 calc(12px + env(safe-area-inset-bottom,0px));background:0 0;flex:none;margin:0;position:static}#confirm-card{border-radius:var(--radius-large);background:var(--surface);box-shadow:var(--shadow);margin-top:auto;padding:6px 16px}.confirm-row{width:100%;min-height:48px;font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-bottom:1px solid #eef0ec;align-items:center;gap:10px;padding:8px 2px;display:flex}.confirm-row:last-of-type{border-bottom:0}#confirm-card hr{border:0;border-top:1px solid #eef0ec;margin:4px 0}.type-pill{background:var(--ink);color:var(--accent);border-radius:999px;padding:4px 10px;font-size:13px;font-weight:700}.leg-badge{background:var(--ink);color:var(--accent);border-radius:7px;padding:3px 7px;font-size:12px;font-weight:800}.confirm-amount{font-variant-numeric:tabular-nums;margin-left:auto;font-size:clamp(30px,9vw,40px);font-weight:850}.confirm-chevron{color:var(--muted);font-size:24px;line-height:1}.confirm-meta-label{color:var(--muted);font-size:13px}.confirm-meta-value{margin-left:auto;font-weight:600}#journal-strip{scrollbar-width:none;flex:none;gap:6px;padding:2px 2px 12px;display:flex;overflow-x:auto}#journal-strip::-webkit-scrollbar{display:none}#journal-strip button{background:var(--surface);color:var(--ink);white-space:nowrap;border:1px solid #dfe5e1;border-radius:999px;flex:none;padding:7px 12px;font-size:13px;font-weight:700}#journal-strip button.pending{color:var(--muted);background:0 0;border:1px dashed #cfd6d0}#journal-strip button.filled{background:var(--surface);color:var(--ink);border:1px solid #dfe5e1}#journal-strip button.active{border-color:var(--ink);background:var(--ink);color:var(--accent)}@keyframes step-in{0%{opacity:0;transform:translate(18px)}to{opacity:1;transform:none}}@media (max-height:700px){#keypad button{min-height:48px}#amount-display{min-height:58px;font-size:clamp(42px,13vw,62px)}}@media (prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}#entry-view.step-guard .step-panel button,#entry-view.step-guard .step-panel input{pointer-events:none}
