:root{color-scheme:light;--ink:#22372e;--muted:#67746c;--green:#284d3e;--line:#dce3d8;--paper:#fffefa}*{box-sizing:border-box}body{margin:0;background:#f3f4ed;color:var(--ink);font:16px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif}main{max-width:1480px;padding:0 40px;margin:auto}header{height:92px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between}.brand{display:flex;align-items:center;gap:14px}.brand strong{font-size:19px}.brand>span:last-child:not(.logo){font-size:13px;color:var(--muted);border-left:1px solid var(--line);padding-left:14px}.logo{background:var(--green);color:white;padding:10px 12px;border-radius:11px;font-size:14px;font-weight:600}h1,h2,p{margin:0}h1{font-size:30px;font-weight:600;line-height:1.4;margin:5px 0 10px}h2{font-size:18px;font-weight:600}.eyebrow{font-size:13px;letter-spacing:2px;color:var(--muted)}.heading{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:30px 0 24px}.heading p:not(.eyebrow){color:var(--muted);font-size:14px}.heading-actions{display:flex;gap:10px}button,.button{display:inline-flex;align-items:center;justify-content:center;font:600 14px/1.5 inherit;font-family:inherit;font-size:14px;min-height:43px;padding:10px 17px;cursor:pointer;border:1px solid transparent;border-radius:7px;text-decoration:none;white-space:nowrap}button:disabled{opacity:.5;cursor:wait}.primary{color:white;background:var(--green)}.primary:hover{background:#183b2e}.secondary{color:var(--green);background:transparent;border-color:#bdcbbb}.quiet{background:transparent;color:var(--muted);padding:6px 10px}.quiet:hover{background:#e9eee3}button:focus-visible,a:focus-visible,input:focus-visible,summary:focus-visible{outline:3px solid #b19a58;outline-offset:3px}.stats{display:grid;grid-template-columns:repeat(3,1fr);border:1px solid var(--line);border-radius:13px;overflow:hidden;margin-bottom:24px;background:var(--paper)}.stat{display:flex;flex-direction:column;gap:8px;padding:22px 26px;border-right:1px solid var(--line)}.stat:last-child{border:0}.stat>span{font-size:14px;color:var(--muted)}.stat strong{font-size:36px;line-height:1.5;font-weight:600;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.stat small{font-size:13px;color:var(--muted)}.balance{background:#e5eddd}.card{background:var(--paper);border:1px solid var(--line);border-radius:12px;margin-bottom:22px;overflow:hidden}.section-head{display:flex;justify-content:space-between;align-items:center;gap:15px;padding:20px 23px;border-bottom:1px solid var(--line)}.section-head>span{font-size:13px;color:var(--muted)}form{margin:0}label{display:flex;flex-direction:column;gap:7px;font-size:14px;color:var(--muted)}input{width:100%;padding:10px 11px;border-radius:6px;border:1px solid #cbd5c7;background:white;color:var(--ink);font:16px/1.4 inherit;font-family:inherit;font-size:16px;min-width:0}input[type=checkbox]{width:17px;height:17px;accent-color:var(--green);cursor:pointer}.settings-form{display:grid;grid-template-columns:minmax(0,1fr) 130px auto;align-items:end;gap:16px;padding:21px 23px}.sharing{padding:0 23px 22px;font-size:14px}.sharing>span{color:var(--muted)}.sharing a{color:var(--green);overflow-wrap:anywhere;margin:5px 20px 0 0;display:inline-block}.payment-form{display:grid;grid-template-columns:180px 180px minmax(0,1fr) auto;gap:16px;align-items:end;padding:21px 23px}.form-actions{display:flex;gap:8px}.tables{display:grid;grid-template-columns:1.15fr 1fr;gap:22px;align-items:start}.tables>.card{min-width:0}.table-scroll{overflow:auto;max-height:650px}table{width:100%;border-collapse:collapse;font-size:14px}th{text-align:left;color:var(--muted);font-weight:500;background:#f7f8f2;position:sticky;top:0}th,td{padding:14px 19px;border-bottom:1px solid #e8ede2;vertical-align:top}td{font-variant-numeric:tabular-nums}th.number,td.number{text-align:right;white-space:nowrap}td.date{white-space:nowrap}td.note{min-width:120px;white-space:normal;overflow-wrap:anywhere}.source{font-size:12px;display:block;color:var(--muted);max-width:330px;overflow-wrap:anywhere;margin-top:4px}.warn{font-size:13px;display:block;color:#945d1e;max-width:340px}.excluded{opacity:.5}.voided{text-decoration:line-through;color:var(--muted)}.row-actions{display:flex;gap:3px}.row-actions button{padding:3px 7px;min-height:32px;font-size:13px}.empty{padding:24px;color:var(--muted);font-size:14px}.warning,#notice{background:#fff1d9;border:1px solid #e4cc9f;border-radius:8px;padding:13px 18px;font-size:14px;margin-bottom:20px;color:#825a1e}#notice{position:fixed;bottom:16px;left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100% - 30px);z-index:4;margin:0;box-shadow:0 4px 18px #22372e22}#notice.success{background:#e8f0e1;border-color:#b3c8a5;color:#395835}.details{padding:18px 23px}.details summary{cursor:pointer;font-size:14px}.details ul{font-size:14px;color:var(--muted);padding-left:20px;overflow-wrap:anywhere}.password-form{display:flex;align-items:end;gap:16px;margin-top:20px}.password-form label{flex:1;min-width:0}.auth{max-width:480px;margin:65px auto;padding:34px}.auth h1{font-size:25px}.auth p{color:var(--muted);font-size:14px}.auth form{display:flex;flex-direction:column;gap:20px;margin-top:26px}.auth button{margin-top:4px}.pending{max-width:650px;margin:65px auto;padding:35px}.pending p{color:var(--muted)}footer{padding:0 2px 30px;color:var(--muted);font-size:13px;display:flex;justify-content:space-between;gap:20px}[hidden]{display:none!important}.admin .tables{grid-template-columns:1fr}.admin .table-scroll{max-height:530px}@media(max-width:1050px){main{padding:0 24px}.tables{grid-template-columns:1fr}.payment-form{grid-template-columns:1fr 1fr}.password-form{flex-wrap:wrap}.password-form label{flex-basis:40%}.stat strong{font-size:29px}}@media(max-width:600px){main{padding:0 15px}header{height:77px}.brand{gap:10px}.brand strong{font-size:17px}.brand>span:last-child:not(.logo){padding-left:9px;font-size:12px}h1{font-size:25px}.heading{align-items:flex-start;flex-direction:column;padding:24px 0 18px}.stats{grid-template-columns:1fr 1fr}.stat{padding:16px 14px}.stat strong{font-size:25px}.stat>span{font-size:13px}.stat small{font-size:12px}.balance{grid-column:1/-1;border-top:1px solid var(--line)!important}.balance strong{font-size:34px}.section-head{padding:17px;flex-wrap:wrap;gap:4px}.section-head>span{font-size:12px}.settings-form{grid-template-columns:1fr 110px;padding:17px;gap:12px}.settings-form label:first-child{grid-column:1/-1}.payment-form{padding:17px;gap:13px}.payment-form label:nth-child(3),.payment-form .form-actions{grid-column:1/-1}.sharing{padding:0 17px 18px}.password-form{display:grid;grid-template-columns:1fr}.auth{padding:26px 23px;margin-top:40px}th,td{padding:12px 13px}.tables{gap:0}td.date{font-size:13px}footer{display:block;line-height:1.8}footer span{display:block}.details{padding:17px}.source{max-width:240px}button,.button{font-size:14px}}

.detail-link{display:inline-block;margin-left:12px;color:var(--green);font-size:14px;text-underline-offset:4px;font-weight:500}.detail-link:hover{color:#142d21}.detail-heading{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:32px 0 28px}.detail-heading h1{font-size:29px}.detail-heading p:not(.eyebrow){font-size:14px;color:var(--muted)}.detail-total{background:#e5eddd;padding:19px 27px;border-radius:12px;min-width:230px}.detail-total span{display:block;font-size:14px;color:var(--muted)}.detail-total strong{display:block;font-size:33px;letter-spacing:.2px;font-variant-numeric:tabular-nums}.sheet-tabs{display:flex;gap:7px;overflow-x:auto;padding-bottom:16px;max-width:100%}.sheet-tabs button{background:transparent;color:var(--muted);border:1px solid var(--line);flex-shrink:0}.sheet-tabs button.active{background:var(--green);color:white;border-color:var(--green)}.detail-table{overflow:auto;max-height:75vh}.detail-table table{min-width:650px}.detail-table th{white-space:nowrap}.detail-table td{white-space:pre-wrap;min-width:100px;max-width:480px;overflow-wrap:anywhere}.detail-table td.number{white-space:nowrap;min-width:90px}.detail-table tr:nth-child(even){background:#f9faf5}.detail-table tr.total-row{background:#e5eddd;font-weight:600}.sheet-intro{padding:16px 22px;background:#f7f8f2;border-bottom:1px solid var(--line);font-size:14px;white-space:pre-wrap}.detail-cards{display:none}.detail-content .section-head{background:var(--paper)}
@media(max-width:700px){.detail-heading{display:block;padding:25px 0 23px}.detail-heading h1{font-size:23px;overflow-wrap:anywhere}.detail-total{margin-top:19px;min-width:0;padding:16px 21px}.detail-total strong{font-size:31px}.detail-table{display:none}.detail-cards{display:flex;flex-direction:column;gap:12px;padding:14px;background:#f3f4ed}.detail-item{background:var(--paper);border:1px solid var(--line);border-radius:10px;padding:17px;min-width:0}.item-heading{display:flex;justify-content:space-between;gap:16px;align-items:flex-start}.item-heading h3{font-size:16px;line-height:1.65;font-weight:550;margin:0;white-space:pre-wrap;overflow-wrap:anywhere;min-width:0}.item-amount{flex-shrink:0;text-align:right;max-width:48%;overflow-wrap:anywhere}.item-amount small{display:block;font-size:12px;color:var(--muted)}.item-amount strong{font-size:21px;font-weight:600;line-height:1.6;font-variant-numeric:tabular-nums}.item-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 18px;border-top:1px solid var(--line);padding-top:13px;margin:13px 0 0}.item-fields .wide{grid-column:1/-1}.item-fields dt{font-size:12px;color:var(--muted);margin-bottom:3px}.item-fields dd{font-size:14px;margin:0;white-space:pre-wrap;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}.total-item{background:#e5eddd;border-color:#b9cbb0}.detail-page footer{font-size:12px}.detail-link{display:inline-block;margin:0 0 0 8px;min-height:30px;vertical-align:middle}td.date:has(.detail-link){white-space:normal}.detail-link{white-space:nowrap}.detail-page .section-head{padding:16px 18px}}

/* Compact mobile detail list; desktop table layout is unchanged. */
@media(max-width:700px){
 .detail-page main{padding:0 12px}
 .detail-page header{height:58px}
 .detail-page .logo{padding:6px 9px;border-radius:8px}
 .detail-page header .button{min-height:36px;padding:6px 12px}
 .detail-page .detail-heading{padding:14px 0 12px}
 .detail-heading .eyebrow,.detail-heading #detailContext{display:none}
 .detail-page .detail-heading h1{font-size:21px;margin:0 0 9px;line-height:1.4}
 .detail-page .detail-total{margin:0;padding:7px 13px;display:flex;align-items:center;justify-content:space-between;gap:12px;border-radius:8px}
 .detail-page .detail-total span{font-size:13px}
 .detail-page .detail-total strong{font-size:25px;line-height:1.5}
 .detail-page .sheet-tabs{gap:7px;padding-bottom:10px}
 .detail-page .sheet-tabs button{min-height:38px;padding:7px 13px}
 .detail-page .section-head{padding:10px 13px;gap:4px}
 .detail-page .section-head h2{font-size:16px}
 .detail-page .detail-content{border-radius:9px;margin-bottom:14px}
 .detail-page .detail-cards{gap:0;padding:0;background:var(--paper)}
 .detail-page .detail-item{border:0;border-bottom:1px solid var(--line);border-radius:0;padding:11px 13px}
 .detail-page .detail-item:last-child{border-bottom:0}
 .detail-page .item-heading{gap:12px}
 .detail-page .item-heading h3{font-size:14px;line-height:1.5}
 .detail-page .item-amount{max-width:35%}
 .detail-page .item-amount small{font-size:12px;line-height:1.3}
 .detail-page .item-amount strong{font-size:18px;line-height:1.4}
 .detail-page .item-fields{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px 12px;margin:7px 0 0;padding:0;border:0}
 .detail-page .item-fields dt{font-size:12px;line-height:1.4;margin:0}
 .detail-page .item-fields dd{font-size:14px;line-height:1.5}
 .detail-page .item-fields .wide{grid-column:1/-1}
 .detail-page .total-item .item-heading{align-items:center}
 .detail-page .total-item .item-heading h3{font-size:16px}
 .detail-page .sheet-intro{padding:10px 13px}
 .detail-page footer{padding-bottom:18px;line-height:1.6}
}

.ledger-switch{display:flex;justify-content:flex-end;padding-top:16px}.ledger-switch+.heading{padding-top:12px}
