/* Entry sheet: amount, fields, category grid, calculator keypad. */

.amount-box { display: flex; align-items: baseline; justify-content: center; gap: 6px; margin: var(--sp-4) var(--sp-4) var(--sp-1); }
.amount-cur { font-size: var(--fs-sheet); font-weight: 600; color: var(--text-2); }
.amount-out { font-size: var(--fs-hero); font-weight: 700; letter-spacing: -.5px; overflow-wrap: anywhere; text-align: center; }
.amount-out.placeholder { color: var(--text-2); }

/* live line: what this entry does to today's limit */
.effect { display: flex; justify-content: center; margin: var(--sp-1) var(--sp-4) var(--sp-2); }
.effect span { padding: 4px 12px; border-radius: 14px; background: var(--fill); color: var(--tint); font-size: var(--fs-small); font-weight: 600; text-align: center; }
.effect span:empty { display: none; }
.effect span.bad { background: var(--primary); color: #fff; }

/* sideways rows of chips and account cards; the last item peeks to show the row scrolls */
.hs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px var(--sp-4); scroll-padding: var(--sp-4); }
.hs::-webkit-scrollbar { display: none; }
.often { justify-content: center; }
.chipb { flex: none; display: flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 12px; border-radius: 22px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--separator); color: var(--text); font-size: var(--fs-head); font-variant-numeric: tabular-nums; }
.chipb[aria-pressed="true"] { background: var(--text); color: var(--bg); box-shadow: none; font-weight: 600; }
.chipb .dot { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--c); color: #fff; }
.chipb .dot .ic { width: 14px; height: 14px; }
.chipb .auto { padding: 1px 5px; border-radius: 6px; background: var(--primary); color: #fff; font-size: var(--fs-tiny); font-weight: 700; }

.entry-fields { margin-top: var(--sp-2); }
.note { display: block; border: 0; width: calc(100% - 2 * var(--sp-4)); margin: 0 var(--sp-4); min-height: var(--tap); padding: 0 12px; border-radius: 12px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--separator); color: var(--text); font-size: var(--fs-unit); }
.note:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--tint); }
.when { display: flex; align-items: center; gap: var(--sp-2); margin: var(--sp-1) var(--sp-4) 0; color: var(--text-2); font-size: var(--fs-head); }
.date-field { margin: 0 var(--sp-4); }
.lab { margin: var(--sp-3) var(--sp-4) var(--sp-1); color: var(--text-2); font-size: var(--fs-small); font-weight: 600; }
.fee { margin: var(--sp-2) var(--sp-4) 0; }

/* accounts as small cards in their bank colours */
.accb { flex: none; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; align-items: flex-start; width: 118px; height: 58px; padding: 7px 10px;
  border-radius: 12px; text-align: left; box-shadow: var(--shadow-card); }
.accb small { font-size: var(--fs-tiny); opacity: .85; }
.accb b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-head); }
.accb[aria-pressed="true"] { outline: 3px solid var(--tint); outline-offset: 2px; }
.accb:disabled { opacity: .35; }
.hs:has(.accb) { padding-block: 6px; }

.keypad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: var(--sp-3) 0 0; padding: var(--sp-2) var(--sp-3);
  position: sticky; bottom: calc(-1 * (var(--sp-5) + env(safe-area-inset-bottom))); padding-bottom: calc(var(--sp-2) + var(--sp-5) + env(safe-area-inset-bottom)); background: var(--bg); }
.amount-result { margin: 0; text-align: center; color: var(--text-2); font-size: var(--fs-body); font-weight: 600; min-height: 1.35em; }
.keypad button { min-height: 50px; border-radius: 12px; background: var(--surface); font-size: var(--fs-title); font-weight: 500; }
.keypad button.op { background: var(--fill); color: var(--tint); font-weight: 600; }
.keypad button:active { background: var(--fill); }
/* Save sits under the keypad, where the thumb already is (as in Money Manager) */
.keypad .keypad-save { grid-column: 1 / -1; background: var(--wine-500); color: #fff; font-size: var(--fs-body); font-weight: 600; }
.keypad .keypad-save:active { background: var(--wine-600); }

.entry-actions { display: flex; justify-content: space-between; margin: var(--sp-4) var(--sp-3) 0; }
.entry-actions .text-btn { display: inline-flex; align-items: center; gap: 6px; }
.entry-actions .ic { width: 18px; height: 18px; }
.hs[data-sub] { margin-top: 6px; }

/* Repeat panel: folded under the date line until "Repeat" is tapped */
.rep-box { margin-top: var(--sp-2); }
.rep-box .seg + * { margin-top: 0; }
.rep-fields { margin: var(--sp-2) var(--sp-3) 0; }
.rep-fields:has(> .field:not([hidden])) { display: block; }
.rep-fields:not(:has(> .field:not([hidden]))) { display: none; }
.plan-now { margin: 0 var(--sp-5) var(--sp-3); }
.plan-stop { display: block; margin: var(--sp-4) auto 0; min-height: var(--tap); }

/* receipt photos: camera next to the note, thumbnails under it, full-screen viewer */
.note-row { display: flex; align-items: center; gap: var(--sp-2); margin: 0 var(--sp-4); }
.note-row .note { flex: 1; min-width: 0; width: auto; margin: 0; }
.cam { flex: none; display: grid; place-items: center; width: var(--tap); height: var(--tap); border-radius: 12px; background: var(--fill); color: var(--tint); }
.cam .ic { width: 22px; height: 22px; }
.thumbs { display: flex; gap: var(--sp-2); margin: var(--sp-2) var(--sp-4) 0; }
.thumb { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: var(--fill); flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.missing span { display: block; padding: 4px; font-size: var(--fs-tiny); line-height: 1.2; color: var(--text-2); }
.sheet:has(.photo-view) { height: calc(100dvh - 24px); }
.photo-view { display: grid; place-items: center; margin: 0 var(--sp-3); min-height: 50dvh; }
.photo-view img { max-width: 100%; max-height: calc(100dvh - 200px); border-radius: 12px; object-fit: contain; }

/* another currency: the code is a button; "Bank took RM" holds what counts */
.amount-cur { min-height: var(--tap); padding: 0 8px; border-radius: 10px; text-decoration: underline dotted 2px; text-underline-offset: 5px; }
.cur-row { justify-content: center; }
.took { margin: var(--sp-1) var(--sp-3) 0; }
.took-hint { margin-top: var(--sp-1); }
.rates-btn { display: block; margin: var(--sp-2) var(--sp-5) 0; min-height: var(--tap); }
.rate-when { display: block; color: var(--text-2); font-size: var(--fs-small); }
