.composer{background:#fff}
.composer .dialog-head{background:#fff;border:0;color:var(--accent)}
.composer .entry-top{padding:0 14px 6px}
.composer .entry-top>.sr{display:none}
.composer .category-grid{gap:10px;padding:12px 14px;min-height:70px}
.composer .category-grid button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;min-height:94px;background:var(--soft,#f0f8e8);border-radius:22px}
.composer .category-grid button.active{border:3px solid var(--accent);background:var(--soft,#f0f8e8)}
.entry-category-symbol{display:grid;place-items:center;border-radius:16px;width:38px;height:38px;background:var(--soft,#f0f8e8);color:var(--muted);font-size:23px;font-weight:700}
.composer .entry-lower{background:var(--accent);color:white;border-radius:25px 25px 0 0;padding:12px 14px max(10px,env(safe-area-inset-bottom))}
.composer .entry-meta button{color:var(--accent);background:var(--soft,#f0f8e8);border-radius:18px;max-width:55%;overflow:hidden;text-overflow:ellipsis}
.composer .note-line{position:relative;background:white;border-radius:12px;align-items:center;gap:0}
.composer .note-line [data-note]{display:block;flex:1;min-width:0;padding:10px 8px;text-align:left;color:#333;font-size:14px;overflow-wrap:anywhere;max-height:74px;overflow:auto}
.entry-labels{display:block;font-size:12px;color:var(--muted);margin-top:4px}
.composer .note-line [data-hash],.composer .note-line [data-notes]{flex:0 0 34px;border-radius:10px;background:var(--soft,#f0f8e8);margin-right:4px;height:32px;font-size:20px}
.composer .amount-line{margin:6px 0 2px}.composer .amount-line input{color:white;font-size:27px;height:36px}
.entry-kind-row{display:flex;justify-content:flex-end;gap:5px;margin-bottom:7px}.entry-kind-row button{font-size:12px;border-radius:16px;padding:6px 12px}.entry-kind-row .active{background:#ffffff30;font-weight:700}
.entry-control-row{display:grid;grid-template-columns:1fr 1fr 1.25fr;gap:6px;margin-bottom:7px}.entry-control-row button{background:var(--line);color:var(--ink);border-radius:20px;padding:10px 4px;font-size:13px}.entry-control-row .save{background:#fff;color:var(--accent);font-weight:700}
.composer .keypad{grid-template-columns:repeat(4,1fr);gap:7px}.composer .keypad button{height:47px;border-radius:24px;color:var(--ink);font-size:25px;box-shadow:0 4px 8px #2224}.composer .keypad button.function{background:var(--line);font-size:23px}
.composer .entry-lower>.row .link{color:white;font-size:12px;padding:6px 10px}
.entry-sheet,.entry-note-sheet{margin:auto auto 0;max-width:600px;width:100%;border-radius:26px 26px 0 0;background:var(--soft,#f0f8e8);max-height:85dvh}
.entry-sheet{height:80dvh}.entry-sheet .dialog-body{flex:1}.entry-sheet .dialog-head{display:flex;border:0;color:var(--accent);background:transparent}.entry-sheet .dialog-head h2{flex:1;font-size:15px}
.entry-choice{display:flex;width:100%;gap:12px;align-items:center;text-align:left;background:var(--soft,#f0f8e8);border-radius:20px;margin:10px 0;padding:14px;min-height:66px}.entry-choice.selected{box-shadow:inset 0 0 0 2px var(--accent)}.entry-choice small{display:block;color:#7d7f8d;font-size:12px;margin-top:5px}.entry-choice .grow{min-width:0;overflow-wrap:anywhere}.choice-symbol{display:grid;place-items:center;width:38px;height:38px;border-radius:13px;background:var(--line);flex-shrink:0;color:var(--accent)}
.entry-sheet-footer{display:flex;gap:10px;padding:12px 16px max(12px,env(safe-area-inset-bottom));background:var(--soft,#f0f8e8);flex-shrink:0;border-top:1px solid var(--soft,#f0f8e8)}.entry-sheet-footer button{flex:1;border-radius:22px;min-height:42px}
.entry-note-sheet .dialog-body{padding:14px;flex:1}.entry-note-sheet .dialog-head{color:var(--accent)}.note-editor{position:relative}.note-editor textarea{height:126px;padding-right:48px;resize:vertical;font-size:17px}.note-editor [data-insert-hash]{position:absolute;right:7px;top:7px;background:var(--soft,#f0f8e8);border-radius:12px;color:var(--accent);font-weight:700;font-size:24px;width:38px;height:38px}
.note-toolbar{display:flex;justify-content:space-between}.note-toolbar button{font-size:12px}.selected-labels>small{display:block;margin-bottom:5px;color:#7c7e90}.selected-labels{margin:8px 0 15px}.label-chip{display:inline-block;padding:8px 12px;margin:4px 5px 4px 0;background:var(--soft,#f0f8e8);border-radius:20px;color:var(--ink);font-size:13px;overflow-wrap:anywhere;max-width:100%}.hidden-label-notice{background:#fff1df;border-radius:12px;padding:12px;color:#805512;font-size:13px}.hidden-label-notice button{font-size:13px}
@media(max-height:680px){.composer .entry-lower{padding:7px 10px}.composer .category-grid button{min-height:66px;gap:4px}.entry-category-symbol{width:25px;height:25px;font-size:16px}.composer .keypad{gap:4px}.composer .keypad button{height:32px;font-size:20px}.composer .amount-line input{height:27px;font-size:22px}.composer .note-line [data-note]{padding:6px;font-size:12px;max-height:52px}.entry-control-row button{padding:7px 3px;font-size:11px}.entry-kind-row{margin-bottom:4px}.entry-kind-row button{padding:4px 7px}.entry-control-row{margin-bottom:5px}.composer .entry-lower>.row .link{padding:4px}.entry-note-sheet{max-height:90dvh}.note-editor textarea{height:88px}}
/* Keep a reachable backdrop around every modal, including full-page sheets. */
dialog.full{width:calc(100% - 16px);height:calc(100dvh - 24px);max-height:calc(100dvh - 24px);margin:12px auto;border-radius:20px}
.composer .entry-calculator{background:#1e1e20;margin:8px -14px -10px;padding:7px 7px max(10px,env(safe-area-inset-bottom));color:var(--soft,#f0f8e8)}
.composer .calculator-top{display:flex;align-items:center;gap:6px;margin-bottom:7px;min-height:36px}
.composer .calculator-top .amount-line{flex:1;min-width:0;margin:0;gap:3px}
.composer .calculator-top input{width:100%;min-width:0;text-align:left;font-size:22px;height:34px;color:white}
.composer .calculator-top small{color:#ddd;font-size:11px}
.composer .entry-kind-row{flex-shrink:0;gap:0;margin:0}.composer .entry-kind-row button{font-size:10px;padding:6px 7px;color:#e2e2e5;white-space:nowrap}.composer .entry-kind-row button.active{background:#69696b;color:white}
.composer .keypad{grid-template-columns:repeat(4,minmax(0,1fr)) 1.3fr;grid-template-rows:repeat(4,clamp(38px,6dvh,55px));gap:5px}
.composer .keypad button{height:100%;min-width:0;background:#303033;color:var(--soft,#f0f8e8);border-radius:6px;box-shadow:none;font-size:23px;padding:3px}
.composer .keypad button:active{filter:brightness(1.3)}
.composer .keypad button.next{grid-column:4;grid-row:1;color:#3994ff;font-size:13px;font-weight:600;background:#303033}
.composer .keypad .operators{grid-column:4;grid-row:2;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1.05;font-size:19px}
.composer .keypad .clear{grid-column:4;grid-row:3;font-size:17px}.composer .keypad .backspace{grid-column:4;grid-row:4;font-size:23px}
.composer .keypad button.entry-date{grid-column:5;grid-row:1/span 2;background:#159c39;font-size:14px;font-weight:650;overflow-wrap:anywhere}
.composer .keypad button.save{grid-column:5;grid-row:3/span 2;background:#2581f5;color:white;font-size:14px;font-weight:650}
.entry-operator-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}.entry-operator-grid button{background:var(--soft,#f0f8e8);border-radius:12px;font-size:28px;min-height:52px;color:var(--accent)}
.entry-date-dialog{background:white;max-width:480px;border-radius:25px;margin:auto auto 20px;max-height:calc(100dvh - 40px)}
.entry-date-dialog .dialog-head{border:0;background:transparent;padding:15px 12px;gap:0}.entry-date-dialog .date-actions{flex:1;display:flex;align-items:center;gap:9px}.date-actions button{min-height:42px;min-width:42px;border-radius:9px}.date-actions .date-mode{font-size:27px;color:#747477}.date-actions .date-today{padding:8px 15px;color:white;background:var(--accent);font-size:14px}.date-actions .date-done{margin-left:auto;font-size:26px;color:var(--accent)}
.entry-date-dialog .dialog-body{padding:15px 20px 24px}.date-month{display:flex;align-items:center;gap:10px;margin:9px 0 24px}.date-month strong{flex:1;font-size:24px}.date-month strong span{color:#999;font-weight:400}.date-month button{font-size:30px;min-width:38px;min-height:42px;color:#777}.date-weekdays,.date-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px;text-align:center}.date-weekdays{font-size:13px;margin-bottom:12px}.date-days button{height:clamp(38px,7dvh,62px);border-radius:24px;font-size:19px}.saturday{color:#278afa}.sunday{color:#f14b55}.date-days button[aria-current=date]{box-shadow:inset 0 0 0 1px var(--line)}.date-days button[aria-pressed=true]{background:var(--accent);color:white}.date-time-hint{text-align:center;color:#888;font-size:11px;margin:20px 0 0}
.entry-date-dialog.wheel-mode .dialog-body{padding:20px 12px 36px}.date-wheels{display:grid;grid-template-columns:1.3fr repeat(4,1fr);gap:3px}.wheel-label{display:block;text-align:center;color:#888;font-size:12px;margin-bottom:12px}.date-wheel{height:200px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none;position:relative;touch-action:pan-y;background:linear-gradient(transparent 79px,var(--soft,#f0f8e8) 80px,var(--soft,#f0f8e8) 120px,transparent 121px);border-radius:10px}.date-wheel::-webkit-scrollbar{display:none}.wheel-track{position:relative}.wheel-value{position:absolute;width:100%;height:40px;display:grid;place-items:center;font-size:20px;color:#777;cursor:pointer;user-select:none}.wheel-value.selected{font-weight:750;color:#222;font-size:23px}
@media(max-height:680px){.composer .entry-calculator{margin:6px -10px -7px;padding:5px 5px 8px}.composer .calculator-top{min-height:30px;margin-bottom:4px}.composer .calculator-top input{height:29px;font-size:19px}.composer .entry-meta{padding-bottom:5px}.composer .keypad{grid-template-rows:repeat(4,38px);gap:4px}.composer .keypad button{font-size:20px}.composer .entry-kind-row button{font-size:9px;padding:6px 5px}.composer .keypad button.next{font-size:11px}.composer .keypad button.entry-date,.composer .keypad button.save{font-size:12px}.entry-date-dialog .dialog-body{padding:7px 12px 15px}.entry-date-dialog .dialog-head{padding:8px}.date-month{margin:3px 0 12px}.date-month strong{font-size:21px}.date-time-hint{margin-top:10px}.date-days button{height:38px}.entry-date-dialog.wheel-mode .dialog-body{padding:10px 10px 20px}}
.composer .keypad button.entry-date span,.composer .keypad button.entry-date small{display:block;white-space:nowrap;color:white}.composer .keypad button.entry-date small{margin-top:4px;font-size:11px;font-weight:400}
.entry-date-dialog .dialog-head{display:flex}.entry-date-dialog .date-actions{min-width:0}.entry-date-dialog .dialog-head>[data-close]{flex-shrink:0}
.loan-entry .dialog-body{padding:0;display:flex;overflow:hidden}.loan-entry-fields{padding:14px 20px;flex:1;min-height:65px;overflow:auto}.loan-entry-title{font-size:12px;color:var(--muted);margin:0 0 18px}.loan-entry-fields>label{display:flex;flex-direction:column;gap:12px;margin-bottom:24px;font-size:16px;font-weight:600}.loan-entry-fields [data-counterparty],.loan-entry-fields [data-loan-account]{background:var(--soft,#f0f8e8);border:0;border-radius:21px;padding:20px;font-size:18px;min-height:66px}.loan-entry-fields [data-loan-account]{color:var(--accent);font-weight:650}.loan-entry-fields [data-counterparty][readonly]{color:var(--muted)}.loan-entry .entry-meta{justify-content:flex-start}.loan-entry .loan-money-target{font-size:12px;color:#ddd;padding-right:8px}.loan-entry-repayment{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:14px}.loan-entry-repayment button{background:var(--soft,#f0f8e8);border:2px solid transparent;border-radius:15px;padding:10px;overflow-wrap:anywhere;text-align:left;font-size:12px}.loan-entry-repayment button.active{border-color:var(--accent);color:var(--accent)}.loan-entry-repayment strong{display:block;margin-top:6px}.loan-entry [data-interest-category]{font-size:13px}.loan-entry .entry-meta button{max-width:none}
@media(max-height:680px){.loan-entry-fields{padding:10px 14px}.loan-entry-title{margin-bottom:10px}.loan-entry-fields>label{margin-bottom:14px;gap:6px;font-size:13px}.loan-entry-fields [data-counterparty],.loan-entry-fields [data-loan-account]{min-height:48px;padding:12px;font-size:15px}.loan-entry .entry-lower{padding-top:7px}.loan-entry .note-line [data-loan-note]{padding:8px;font-size:12px;text-align:left;flex:1}.loan-entry-repayment{margin-bottom:10px}.loan-entry-repayment strong{margin-top:3px}}
.loan-entry .note-line [data-loan-note]{padding:10px;text-align:left;flex:1;color:#333;max-height:72px;overflow:auto;overflow-wrap:anywhere}


/* Inline note editing replaces the calculator without opening another modal. */
.composer .note-editing>.entry-meta,.composer .note-editing>.entry-calculator{display:none}
.entry-note-inline{max-height:min(340px,65dvh);overflow-y:auto;scrollbar-width:none}
.note-inline-actions{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:-6px;color:white}
.note-inline-actions>span{font-size:12px;color:var(--soft,#f0f8e8)}
.note-inline-actions button{min-height:44px;min-width:44px;padding:5px 8px;font-size:14px;color:white}
.note-inline-actions [data-note-cancel]{font-size:24px}
.entry-note-inline .note-editor textarea{display:block;min-height:80px;height:110px;max-height:180px;resize:none;background:white;border:0;border-radius:12px;color:var(--ink);padding:12px 54px 12px 12px;line-height:1.5;font-size:16px}
.entry-note-inline .note-editor [data-insert-hash]{width:44px;height:44px;top:4px;right:4px}
.note-chip-strip{display:flex;gap:7px;align-items:center;overflow-x:auto;overflow-y:hidden;white-space:nowrap;scrollbar-width:none;touch-action:pan-x;overscroll-behavior-x:contain;padding:7px 0 1px;min-height:44px}
.note-chip-strip[hidden],.note-inline-notice[hidden]{display:none}
.note-chip-strip .label-chip{flex:0 0 auto;max-width:260px;min-height:44px;margin:0;padding:9px 13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px;background:var(--soft,#f0f8e8);color:var(--ink)}
.note-chip-strip[data-selected-labels]{padding-top:6px;min-height:0}.note-chip-strip[data-selected-labels] .label-chip{background:#ffffff25;color:white}
.note-suggestion-empty{font-size:12px;color:var(--soft,#f0f8e8);padding:8px 3px}
.note-inline-notice{font-size:12px;line-height:1.5;color:#ffedc5;padding-top:7px;white-space:normal}
.note-inline-notice button{color:white;text-decoration:underline;min-height:44px;padding:4px 6px}
.note-inline-actions button:disabled{opacity:.45}
.date-days button[aria-current=date]:not([aria-pressed=true]){background:#e7efff;color:#244a9b;box-shadow:inset 0 0 0 2px #809ee3;font-weight:750}
.date-days button[aria-current=date][aria-pressed=true]{box-shadow:inset 0 0 0 2px #a8c2ff}
@media(max-height:680px){.entry-note-inline .note-editor textarea{height:90px}.entry-note-inline{max-height:65dvh}}
