/* Receipt items on the Add sheet and in transaction details. */
.entry-items { display:grid; gap:8px; margin:-4px 16px 12px; }
.entry-items[hidden] { display:none; }
/* Upload screenshot and Add items sit side by side with the same weight: two equal outlined buttons. */
.entry-items-head { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:stretch; gap:8px; }
.entry-items-head :is(.button.entry-scan,.text-button) { display:inline-flex; align-items:center; justify-content:center; min-width:0; min-height:44px; padding:4px 8px; gap:6px; border:1px solid var(--border); border-radius:var(--radius-sm); background:transparent; color:var(--text); font-size:var(--text-sm); font-weight:500; line-height:1.2; text-align:center; text-decoration:none; white-space:normal; }
.entry-items-head .icon { width:18px; height:18px; flex:none; }
.entry-items[aria-busy=true] .entry-scan { opacity:.6; }
.entry-items-status:empty, .entry-items-summary:empty { display:none; }
.entry-items-status { margin:0; }
.entry-item-list { display:grid; gap:6px; margin:0; padding:0; list-style:none; }
.entry-item-list[hidden], .receipt-group[hidden] { display:none; }
.receipt-group { display:grid; gap:6px; }
.receipt-group h4, .receipt-check h4 { margin:6px 0 0; font-size:var(--text-sm); font-weight:600; color:var(--muted); }
.receipt-group > .text-button { justify-self:start; display:inline-flex; align-items:center; gap:6px; min-height:40px; font-size:var(--text-sm); }
.receipt-group > .text-button .icon { width:16px; height:16px; }
/* Two lines per entry so full names fit a 360px Android screen: the name and a remove button, then quantity (or line
   type) and price. */
.entry-item { display:grid; grid-template-columns:minmax(0,1fr) 108px 40px; grid-template-areas:"name name remove" "meta amount ."; align-items:center; gap:6px; padding-bottom:8px; border-bottom:1px solid var(--divider,var(--border)); }
.entry-item:last-child { border-bottom:0; padding-bottom:0; }
.entry-item-name { grid-area:name; }
.entry-item-qty, .entry-item-kind { grid-area:meta; justify-self:start; }
.entry-item-amount { grid-area:amount; }
.entry-item-remove { grid-area:remove; }
.entry-item input, .entry-item select { min-height:44px; min-width:0; margin:0; font-size:var(--text-md); }
.entry-item-qty { width:72px; text-align:center; padding-inline:4px; font-variant-numeric:tabular-nums; }
.entry-item-kind { width:min(100%,140px); }
.entry-item-amount { text-align:right; font-variant-numeric:tabular-nums; }
.entry-item[data-kind=discount] .entry-item-amount { color:var(--income); }
.entry-item-remove { width:40px; height:40px; min-width:40px; padding:10px; color:var(--muted); }
.entry-item input[aria-invalid] { border-color:var(--error,#d33); }
/* A value the reader was unsure of: amber edge and a note, until the person types over it. */
.entry-item input.is-unsure { border-color:var(--warning); background:var(--warning-soft); box-shadow:inset 3px 0 0 var(--warning); }
.entry-item-note { grid-column:1 / -1; margin:-2px 0 2px; color:var(--warning); font-size:var(--text-xs,12px); }
.entry-item:not(.is-unsure) .entry-item-note { display:none; }
.receipt-check { display:grid; gap:8px; padding:12px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface,transparent); }
.receipt-check[hidden] { display:none; }
.receipt-check-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:2px 12px; align-items:baseline; font-variant-numeric:tabular-nums; }
.receipt-check-row > span:first-child { font-weight:600; }
.receipt-check-values { grid-column:1 / -1; display:flex; flex-wrap:wrap; gap:2px 16px; font-size:var(--text-sm); color:var(--muted); }
.receipt-check-values strong { color:var(--text); font-weight:600; }
.receipt-check-status { justify-self:end; text-align:right; font-size:var(--text-sm); }
.receipt-check-row[data-status=ok] .receipt-check-status { color:var(--income); }
.receipt-check-row[data-status=mismatch] .receipt-check-status { color:var(--warning); font-weight:600; }
.receipt-check-row[data-status=unknown] .receipt-check-status { color:var(--muted); }
.receipt-check .icon { width:16px; height:16px; vertical-align:-3px; }
.receipt-check-verdict { margin:0; font-size:var(--text-sm); }
.receipt-check-verdict[data-unresolved=false] { color:var(--income); }
.receipt-check-verdict[data-unresolved=true] { color:var(--warning); }
.receipt-suggestions, .receipt-flags { display:grid; gap:4px; margin:0; padding-left:18px; font-size:var(--text-sm); }
.receipt-suggestions .text-button, .receipt-check > .text-button { min-height:40px; font-size:var(--text-sm); }
.receipt-check > .text-button { justify-self:start; }
.receipt-confirm { display:flex; align-items:center; gap:10px; min-height:44px; font-size:var(--text-sm); font-weight:500; }
.receipt-confirm input { width:22px; height:22px; flex:none; margin:0; }
.receipt-original summary { min-height:40px; display:flex; align-items:center; font-size:var(--text-sm); color:var(--accent); cursor:pointer; }
.receipt-original img { display:block; width:100%; max-height:70vh; object-fit:contain; border:1px solid var(--border); border-radius:var(--radius-xs); }
.entry-items-summary { display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px; margin:2px 0 0; color:var(--muted); font-variant-numeric:tabular-nums; }
.entry-items-summary .icon { width:16px; height:16px; vertical-align:-3px; color:var(--income); }
.entry-items-gap { color:var(--warning,var(--text)); }
.entry-items-summary .text-button { min-height:36px; font-size:var(--text-sm); }

.detail-items { margin:12px 0 4px; }
.detail-items h4 { margin:0 0 6px; font-size:var(--text-sm); color:var(--muted); font-weight:600; }
.detail-items ul { display:grid; gap:6px; margin:0; padding:0; list-style:none; }
.detail-items li { display:flex; justify-content:space-between; gap:12px; font-size:var(--text-md); font-variant-numeric:tabular-nums; }
.detail-items li small { color:var(--muted); }
.detail-items-extra { margin-top:8px!important; padding-top:8px!important; border-top:1px solid var(--border); }
.detail-items-extra li { color:var(--muted); font-size:var(--text-sm); }
.detail-items li.discount span:last-child { color:var(--income); }
/* Item spend: the cost of matching receipt lines, above the matching transactions in Search and on Stats. */
.item-spend { display:grid; gap:4px; margin:12px 0; padding:14px 16px; border:1px solid var(--border); border-left:4px solid var(--brand-soft); border-radius:var(--radius-md); background:var(--surface); }
.item-spend-label { font-size:var(--text-sm); color:var(--muted); }
.item-spend-amount { font-size:1.5rem; font-weight:650; color:var(--text); font-variant-numeric:tabular-nums; }
.item-spend small { color:var(--muted); }
.item-spend-names { display:grid; gap:2px; margin:6px 0 0; padding:0; list-style:none; font-size:var(--text-sm); }
.item-spend-names li { display:flex; justify-content:space-between; gap:12px; }
.item-spend-names li span:first-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
.item-spend-names li span:last-child { flex:none; font-variant-numeric:tabular-nums; color:var(--text); }
/* "Read as": how a plain-language search was understood, with one-tap fixes. */
.search-reading { display:flex; flex-wrap:wrap; align-items:center; gap:6px 8px; margin:10px 0 0; font-size:var(--text-sm); }
.search-reading-label { color:var(--muted); }
.search-reading-chip { display:inline-flex; align-items:center; gap:2px; min-height:32px; padding:0 4px 0 12px; border:1px solid var(--border); border-radius:var(--radius-pill); background:var(--surface); color:var(--text); font-weight:550; }
.search-reading-chip:not(:has(button)) { padding-right:12px; }
.search-reading-clear { display:inline-grid; place-items:center; width:28px; height:28px; padding:0; border:0; border-radius:50%; background:none; color:var(--muted); cursor:pointer; }
.search-reading-clear .icon { width:14px; height:14px; }
.search-reading-alt { min-height:32px; font-size:var(--text-sm); }
.search-reading-note { flex-basis:100%; margin:0; }
.item-spend-others { margin-top:8px; font-size:var(--text-sm); }
.item-spend-others summary { cursor:pointer; color:var(--muted); min-height:32px; display:flex; align-items:center; }
.item-spend-others p { margin:6px 0 0; }
.item-spend-others summary::after { content:'›'; margin-left:6px; transition:transform var(--motion-exit) var(--motion-ease); }
.item-spend-others[open] summary::after { transform:rotate(90deg); }
