/* Bank of Mango — app styles. Brand tokens come from mangonese.css. */
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-sans); background: var(--bg-primary); color: var(--text-primary); }
#app { max-width: 640px; margin: 0 auto; min-height: 100vh; }
#topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: max(12px, env(safe-area-inset-top)) 14px 12px; position: sticky; top: 0; z-index: 5;
  background: var(--bg-primary); }
.tb-title { font-size: 1.15rem; margin: 0; }
.tb-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { min-width: 44px; min-height: 44px; border: 0; background: var(--bg-elevated);
  color: var(--text-primary); border-radius: var(--radius-md); font-size: 1.1rem; }
#searchbar { padding: 4px 14px 8px; }

/* segmented toggles */
#controls { display: flex; gap: 8px; padding: 0 14px 12px; }
.segmented { display: inline-flex; flex: 1; background: var(--bg-elevated);
  border-radius: var(--radius-md); padding: 3px; gap: 2px; }
.seg { flex: 1; border: 0; background: transparent; color: var(--text-secondary);
  min-height: 38px; padding: 0 10px; border-radius: calc(var(--radius-md) - 3px);
  font-size: .82rem; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .15s ease, color .15s ease; }
.seg[aria-pressed="true"] { background: var(--mango); color: #1a1a1a; font-weight: 600; }
.seg:active { transform: scale(.97); }
#search-input { width: 100%; min-height: 46px; padding: 0 14px; border: 0; border-radius: var(--radius-md);
  background: var(--bg-surface); color: var(--text-primary); font-size: 1rem; }
#view { padding: 4px 14px 80px; }
/* keep the area a stable height while searching so results don't jump per keystroke */
#view.is-search { min-height: calc(100vh - 210px); }
.empty { color: var(--text-muted); text-align: center; padding: 40px 16px; }

/* render markup (Task 7) */
.cat-h { font-size: .9rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em; margin: 18px 0 8px; }
.cat-card, .search-card { background: var(--bg-surface); border-radius: var(--radius-md); padding: 10px 12px; margin-bottom: 8px; }
.cc-name, .sc-name, .ct-name { font-weight: 600; }
.benefit-row { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-top: 1px solid var(--bg-elevated); }
.benefit-row:first-child { border-top: 0; }
.benefit-row.used { opacity: .55; }
.b-value { font-size: .98rem; }
.b-meta { font-size: .78rem; color: var(--text-muted); }
.credit-check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.credit-check input { width: 22px; height: 22px; }
.credit-period { font-size: .72rem; color: var(--text-secondary); text-transform: uppercase; }
.card-tile { background: var(--bg-surface); border-radius: var(--radius-md); padding: 8px 12px; margin-bottom: 10px; }
.card-tile summary { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.ct-name { flex: 1; }

/* card art: real image when present, branded fallback tile otherwise */
.card-art { position: relative; flex: none; width: 56px; height: 36px; border-radius: 6px; overflow: hidden;
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-surface)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.card-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ca-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: .55rem; font-weight: 700; letter-spacing: .03em; color: #fff; opacity: .82; text-transform: uppercase; }
.card-art[data-net="Amex"] { background: linear-gradient(135deg, #2e7d8f, #16404a); }
.card-art[data-net="Visa"] { background: linear-gradient(135deg, #2a4d8f, #15294d); }
.card-art[data-net="Mastercard"] { background: linear-gradient(135deg, #b5562a, #6f2912); }
.card-art[data-net="Discover"] { background: linear-gradient(135deg, #d98a2b, #8f5212); }
.pr-name { flex: 1; }
.ct-fee { color: var(--text-muted); font-size: .8rem; } .ct-sum { color: var(--text-secondary); font-size: .85rem; margin: 4px 0; }
.credit-badge { margin-left: auto; font-size: .72rem; background: var(--bg-elevated); padding: 3px 8px; border-radius: 999px; }
.pick-row, .request-note { display: flex; align-items: center; gap: 10px; padding: 12px 4px; min-height: 44px; }
.pr-issuer { margin-left: auto; color: var(--text-muted); font-size: .8rem; }
.request-note { color: var(--text-muted); font-size: .82rem; justify-content: center; }
#picker-filter, .picker input[type="search"] { width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--radius-md); background: var(--bg-elevated); color: var(--text-primary); margin-bottom: 8px; }
/* fixed-height scrollable list so the picker modal doesn't resize as you filter */
.pick-list { height: 56vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* modal (Task 8) */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; z-index: 20; }
.modal { background: var(--bg-primary); width: 100%; max-width: 640px; margin: 0 auto; max-height: 85vh; overflow: auto;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 14px; }
.modal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dataset-note { text-align: center; color: var(--text-muted); font-size: .75rem; padding: 18px 0 6px; }

/* settings sheet */
.set-section { margin: 6px 0 16px; }
.set-label { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 8px; }
.set-row { display: flex; justify-content: space-between; align-items: center; min-height: 40px; }
.set-val { color: var(--text-secondary); }
.set-section .segmented { display: flex; width: 100%; }
.set-btn { width: 100%; min-height: 46px; border: 0; border-radius: var(--radius-md); background: var(--mango); color: #1a1a1a; font-weight: 600; font-size: .95rem; margin-top: 8px; cursor: pointer; }
.set-status { margin-top: 10px; color: var(--text-secondary); font-size: .88rem; min-height: 20px; }
.set-status .set-btn { background: var(--bg-elevated); color: var(--text-primary); }
.set-note { color: var(--text-muted); font-size: .76rem; margin-top: 6px; line-height: 1.4; }
