*{box-sizing:border-box}
html,body{margin:0;background:#FFFDF8;color:#2b2620;font-family:-apple-system,BlinkMacSystemFont,"PingFang TC","Noto Sans TC","Microsoft JhengHei",sans-serif;-webkit-text-size-adjust:100%}
button,input,select,textarea{font-family:inherit;font-size:16px}
.wrap{max-width:1100px;margin:0 auto;padding:12px 14px 120px}
.brand{display:flex;align-items:center;gap:10px;color:#7a6f63;font-size:14px;justify-content:space-between}
.brand .l{display:flex;align-items:center;gap:8px}
.link{background:none;border:none;color:#7a6f63;text-decoration:underline;cursor:pointer;padding:8px 4px;font-size:14px}
h2{font-size:20px;margin:14px 0 8px;display:flex;justify-content:space-between;align-items:center;gap:8px}
.btn{min-height:44px;padding:8px 16px;border-radius:12px;border:1px solid #ddd3c4;background:#F7F3EA;color:#2b2620;cursor:pointer;font-weight:600}
.btn.primary{background:#C4A574;border-color:#C4A574;color:#fff}
.btn.danger{background:#fff;border-color:#E53935;color:#C62828}
.row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.sticky-bar{position:sticky;top:0;z-index:8;background:#FFFDF8;padding:4px 0 10px}
.book{display:inline-flex;flex-direction:column;padding:8px 12px;border-radius:12px;background:#F3E6D0;border:1px solid #E0C89A;margin-bottom:8px}
.book .k{font-size:11px;color:#7a6f63}.book .v{font-size:18px;font-weight:600}
.chips{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px}
.chip{display:inline-flex;flex-direction:column;align-items:flex-start;padding:6px 10px;min-height:40px;border-radius:12px;border:1px solid #e3dccf;background:#fff;cursor:pointer;color:#2b2620}
.chip.on{border:1.5px solid #C4A574;background:#F8EBD6}
.chip .k{font-size:10px;color:#7a6f63;line-height:13px}.chip .v{font-size:15px;font-weight:600;line-height:18px}
.seg{display:inline-flex;background:#F1EBE0;border-radius:12px;padding:3px;gap:2px;margin-bottom:8px;flex-wrap:wrap}
.seg button{border:none;background:transparent;padding:8px 12px;border-radius:10px;cursor:pointer;min-height:36px;color:#2b2620;font-size:14px}
.seg button.on{background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.12);font-weight:600}
.legend{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:8px;font-size:11px;color:#7a6f63}
.legend span{display:inline-flex;align-items:center;gap:4px}.legend i{width:12px;height:12px;border-radius:3px;display:inline-block}
.search{display:flex;align-items:center;gap:8px;border:1px solid #e3dccf;border-radius:12px;padding:0 10px;min-height:44px;background:#fff}
.search input{flex:1;min-width:0;border:none;outline:none;background:transparent;min-height:42px}
.search .x{width:32px;height:32px;border:none;border-radius:16px;background:#EFE8DC;cursor:pointer;font-size:18px;padding:0}
.hint{font-size:13px;color:#7a6f63;margin:6px 0}
.tbl-wrap{overflow-x:auto;border:1px solid #e3dccf;border-radius:12px;margin-top:6px;-webkit-overflow-scrolling:touch}
table.units{border-collapse:collapse;width:max-content;min-width:100%}
table.units th,table.units td{padding:5px 6px;font-size:12px;line-height:15px;white-space:nowrap;vertical-align:middle;border-bottom:1px solid #e3dccf;text-align:left}
table.units th{background:#F7F3EA;color:#7a6f63;font-weight:600;white-space:normal}
table.units tr{cursor:pointer}
.s0,.s1{position:sticky;z-index:2}
.s0{left:0;width:84px;min-width:84px;max-width:84px;white-space:normal!important;font-weight:600}
.s1{left:84px;width:58px;min-width:58px;max-width:58px;box-shadow:2px 0 4px rgba(0,0,0,.08)}
th.s0,th.s1{z-index:4}
td.st{font-weight:600;text-decoration:underline}
td.notes{white-space:normal!important;min-width:140px;max-width:180px}
.c-paid{background:#FFF59A}.c-vacant{background:#90CAF9}.c-notdue{background:#FFFFFF}.c-unclear{background:#FFCC80}.c-sale{background:#FF8A80}
.c-bpaid{background:#F8C8D4}.c-bnotdue{background:#B9E28C}
.tabs{position:fixed;left:0;right:0;bottom:0;z-index:50;background:rgba(255,253,248,.96);border-top:1px solid #e3dccf;padding:8px 12px calc(8px + env(safe-area-inset-bottom));display:flex;justify-content:center}
.tabs .seg{margin:0;width:100%;max-width:480px;display:flex}.tabs .seg button{flex:1;font-size:16px;min-height:44px}
.detail .top{position:sticky;top:0;z-index:5;background:#FFFDF8;padding:10px 0 8px}
.back{min-height:44px;padding:8px 4px;border:none;background:transparent;font-size:17px;font-weight:600;cursor:pointer;color:#2b2620}
.field{display:flex;flex-direction:column;gap:4px;margin:10px 0}
.field label{font-size:14px;color:#7a6f63}
.field input,.field textarea,.field select{min-height:44px;border:1px solid #ddd3c4;border-radius:10px;padding:8px 10px;background:#fff;color:#2b2620;width:100%}
.field textarea{min-height:80px}
.ro{padding:10px 12px;border-radius:10px;background:#F7F3EA;margin:10px 0;font-size:15px}
.badge{display:inline-block;padding:3px 10px;border-radius:999px;font-size:13px;font-weight:600;border:1px solid rgba(0,0,0,.1)}
.overlay{position:fixed;inset:0;z-index:200;background:rgba(0,0,0,.55);display:flex;align-items:center;justify-content:center;padding:16px}
.panel{width:100%;max-width:420px;max-height:100%;overflow-y:auto;background:#FFFDF8;border-radius:14px;padding:20px}
.panel .ttl{font-size:20px;font-weight:600}
.panel .big{width:100%;min-height:52px;margin-top:10px;border-radius:12px;border:1px solid #ddd3c4;background:#F7F3EA;font-size:18px;font-weight:600;cursor:pointer;color:#2b2620}
.panel .big.cur{border:2px solid #2b2620}.panel .big.primary{background:#C4A574;color:#fff;border-color:#C4A574}
.callout{background:#FFF3E0;border:1px solid #FFB74D;border-radius:10px;padding:10px 12px;margin:8px 0}
.card{border:1px solid #e3dccf;border-radius:12px;padding:12px;margin:8px 0;background:#fff}
.msg{white-space:pre-wrap;background:#fff;border:1px solid #e3dccf;border-radius:10px;padding:12px;font-size:14px;margin:8px 0}
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:90px;background:#2b2620;color:#fff;padding:10px 16px;border-radius:10px;z-index:300;font-size:14px;max-width:90%}
.loading{padding:40px;text-align:center;color:#7a6f63}
