/* Bennys design system */
:root {
  --felt: #0A0E17; --card: #121826; --raise: #1A2233;
  --hairline: #232C3D; --ink: #EDF2F9; --ink-dim: #97A3B6;
  --ink-faint: #67728A;
  --teal: #12C7B2; --teal-deep: #0A8F80;
  --blue: #4E8FF5; --blue-deep: #14307D;
  --amber: #F5A524;
  --mint: #3DBE6B; --signal: #E0564F; --sky: #7FB4FF;
  --silver: #D6DDE8;
  --r-lg: 18px; --r-md: 13px; --r-pill: 999px;
  --display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --ui: 'Manrope', -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--ui); color: var(--ink);
  background:
    radial-gradient(1100px 500px at 50% -10%, rgba(18,199,178,.07), transparent 60%),
    var(--felt);
  min-height: 100vh; -webkit-font-smoothing: antialiased;
}
#app { max-width: 460px; margin: 0 auto;
  padding: calc(.9rem + env(safe-area-inset-top)) .95rem
           calc(4.5rem + env(safe-area-inset-bottom)); }
a { color: var(--sky); }

/* ---------- brand / hero ---------- */
.brand { display: flex; align-items: center; gap: .7rem;
  margin: .2rem 0 .15rem; }
.brand-icon { width: 42px; height: 42px; border-radius: 11px;
  border: 1px solid var(--hairline); }
.brand-name { font-family: var(--display); font-weight: 700;
  font-size: 1.55rem; line-height: 1; letter-spacing: -.01em; }
.brand-tag { font-size: .76rem; color: var(--ink-dim); margin-top: .2rem; }
.hint { font-size: .76rem; color: var(--ink-faint); margin: .25rem 0 .55rem; }
.hero { text-align: center; padding: 1.6rem .5rem .9rem; }
.hero-icon { width: 78px; height: 78px; border-radius: 20px;
  border: 1px solid var(--hairline);
  box-shadow: 0 14px 34px rgba(0,0,0,.45); }
.hero-name { font-family: var(--display); font-weight: 700;
  font-size: 2.35rem; margin-top: .7rem; letter-spacing: -.02em; }
.hero-thesis { font-family: var(--display); font-weight: 500;
  font-size: 1.06rem; color: var(--teal); margin-top: .15rem; }
.hero-sub { font-size: .86rem; color: var(--ink-dim); line-height: 1.55;
  max-width: 330px; margin: .55rem auto 0; }
.sub { font-size: .8rem; color: var(--ink-dim); margin: 0 0 .4rem; }
.sub b { color: var(--ink); }
.err { color: #ff8f88; font-size: .8rem; margin: .3rem 0; min-height: 1em; }
.ok { color: #6fd39a; font-size: .8rem; margin: .3rem 0; }

/* ---------- inputs & buttons ---------- */
input[type=text], input[type=email], input[type=password], select {
  width: 100%; background: var(--card); color: var(--ink);
  border: 1px solid var(--hairline); border-radius: var(--r-md);
  padding: .72rem .95rem; font-size: 16px; font-family: var(--ui);
  outline: none; transition: border-color .15s, box-shadow .15s;
  appearance: none; -webkit-appearance: none;
}
input:focus, select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(18,199,178,.18);
}
input::placeholder { color: var(--ink-faint); }
select { background-image:
  linear-gradient(45deg, transparent 50%, var(--ink-dim) 50%),
  linear-gradient(135deg, var(--ink-dim) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
  background-size: 5px 5px; background-repeat: no-repeat; }
.field { margin: .45rem 0; }
label.small { display:block; font-size:.7rem; color:var(--ink-faint);
  margin: 0 0 .2rem .2rem; text-transform: uppercase;
  letter-spacing: .08em; font-weight: 700; }
button {
  width: 100%; border-radius: var(--r-md); padding: .7rem .6rem;
  min-height: 48px; font-family: var(--ui); font-weight: 700;
  font-size: .92rem; cursor: pointer;
  background: linear-gradient(180deg, #17D8C1, #0FA894);
  color: #04211D; border: 1px solid var(--teal-deep);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35),
              0 6px 16px rgba(0,0,0,.35);
  transition: filter .12s, transform .12s; margin: .3rem 0 .1rem;
}
button:hover { filter: brightness(1.05); transform: translateY(-1px); }
button:disabled { background: var(--raise); color: var(--ink-faint);
  border-color: var(--hairline); box-shadow: none; cursor: default;
  transform: none; filter: none; }
button.ghost { background: var(--raise); color: var(--ink-dim);
  border-color: var(--hairline); box-shadow: none; }
button.ghost:hover { color: var(--ink); filter: none; }
button.danger { background: linear-gradient(180deg, #E9766F, #CE4A42);
  border-color: #A33630; color: #FFF3F1; }
button.link { background: none; border: none; box-shadow: none;
  color: var(--sky); min-height: 0; padding: .3rem; width: auto;
  font-weight: 600; font-size: .8rem; }
button.link:hover { transform: none; filter: none;
  text-decoration: underline; }
.row2 { display: flex; gap: .55rem; }
.row2 > * { flex: 1; }

/* ---------- auth tabs ---------- */
.authtabs { display: flex; gap: 7px; margin: .6rem 0 .4rem; }
.authtabs button { min-height: 44px; margin: 0;
  background: var(--card); color: var(--ink-dim);
  border: 1px solid var(--hairline); box-shadow: none;
  border-top: 2px solid var(--hairline); font-size: .85rem; }
.authtabs button.active {
  background: linear-gradient(180deg, #07231F, #061A18);
  border-color: rgba(18,199,178,.45);
  border-top: 2px solid var(--teal); color: var(--teal); }

/* ---------- card strip ---------- */
.strip { display: flex; gap: 7px; overflow-x: auto; padding: 8px 2px 10px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; background: var(--card); color: var(--ink-dim);
  border: 1px solid var(--hairline); border-top: 2px solid var(--hairline);
  border-radius: var(--r-md); padding: 10px 15px; min-height: 44px;
  font-weight: 600; font-size: .83rem; white-space: nowrap;
  cursor: pointer; box-shadow: none; width: auto; margin: 0;
  transition: color .15s, border-color .15s; }
.chip:hover { transform: none; filter: none; }
.chip.active { background: linear-gradient(180deg, #07231F, #061A18);
  border-color: rgba(18,199,178,.45);
  border-top: 2px solid var(--teal); color: var(--teal); }

/* ---------- card hero / stats ---------- */
.card-hero { background: linear-gradient(160deg, #1C2334 0%, #131826 70%);
  border: 1px solid var(--hairline); border-radius: var(--r-lg);
  padding: 1rem 1.05rem .95rem; margin: .25rem 0 .5rem; }
.h-name { font-family: var(--display); font-weight: 700;
  font-size: 1.18rem; letter-spacing: -.01em; }
.h-meta { font-size: .75rem; color: var(--ink-dim); margin-top: .2rem; }
.h-stats { font-size: .78rem; color: var(--teal); font-weight: 600;
  margin-top: .5rem; }
.stat-row { display: flex; gap: .55rem; margin: .5rem 0 .25rem; }
.stat-box { flex: 1; background: var(--card);
  border: 1px solid var(--hairline); border-radius: var(--r-md);
  padding: .6rem .2rem .5rem; text-align: center; }
.stat-num { font-family: var(--display); font-weight: 700;
  font-size: 1.18rem; }
.stat-num.gold { color: var(--teal); }
.stat-num.green { color: #4FD08A; }
.stat-lab { font-size: .6rem; color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: .09em; margin-top: .1rem; }

/* ---------- benefit cards ---------- */
.benefit-card { background: linear-gradient(165deg, #171D2C 0%, #12172294 85%);
  border: 1px solid var(--hairline); border-radius: var(--r-lg);
  padding: .9rem 1rem .75rem; margin: .6rem 0 .2rem;
  transition: transform .12s ease, border-color .15s; }
@media (hover:hover) {
  .benefit-card:hover { transform: translateY(-1px);
    border-color: #33405A; }
}
.benefit-card.urgent { border-left: 3px solid var(--amber);
  box-shadow: 0 0 22px rgba(245,165,36,.12); }
.benefit-card.used { opacity: .5; filter: grayscale(.35); }
.benefit-card.used .bc-value { color: var(--ink-faint);
  text-decoration: line-through; text-shadow: none; }
.bc-top { display: flex; justify-content: space-between;
  align-items: flex-start; gap: .6rem; }
.card-name { font-size: .66rem; font-weight: 700; letter-spacing: .11em;
  text-transform: uppercase; color: var(--teal-deep);
  padding-top: .2rem; }
.bc-value { font-family: var(--display); font-weight: 700;
  font-size: 1.45rem; line-height: 1; color: var(--teal);
  text-shadow: 0 1px 0 rgba(255,255,255,.14), 0 -1px 0 rgba(0,0,0,.55);
  white-space: nowrap; }
.benefit-name { font-size: .99rem; font-weight: 700; line-height: 1.32;
  margin: .3rem 0; }
.benefit-desc { font-size: .8rem; color: var(--ink-dim);
  line-height: 1.5; }
.benefit-meta { display: flex; flex-wrap: wrap; gap: .35rem;
  margin-bottom: .4rem; }
.pill { font-size: .67rem; font-weight: 600; padding: .2rem .6rem;
  border-radius: var(--r-pill); background: #1D2434;
  color: var(--ink-dim); border: 1px solid var(--hairline); }
.pill.days-ok { color: var(--sky); }
.pill.days-warn { color: var(--amber);
  border-color: rgba(245,165,36,.5); }
.pill.days-expired { color: var(--signal);
  border-color: rgba(224,86,79,.4); }
@keyframes pulsewarn {
  0%,100% { opacity: 1; text-shadow: 0 0 14px rgba(245,165,36,.55); }
  50% { opacity: .45; text-shadow: none; }
}
.expires-soon { animation: pulsewarn 2.2s ease-in-out infinite;
  color: var(--amber); font-weight: 800; font-size: .72rem;
  letter-spacing: .06em; }

/* ---------- toggles ---------- */
.tgrow { display: flex; align-items: center; gap: .55rem;
  margin: .35rem 0; }
.tglabel { font-size: .84rem; font-weight: 600; }
.switch { position: relative; width: 46px; height: 26px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.track { position: absolute; inset: 0; border-radius: var(--r-pill);
  background: var(--signal); transition: background-color .15s;
  cursor: pointer; }
.track::before { content: ""; position: absolute; width: 20px;
  height: 20px; border-radius: 50%; background: #fff; top: 3px;
  left: 3px; transition: transform .15s; }
.switch input:checked + .track { background: var(--mint); }
.switch input:checked + .track::before { transform: translateX(20px); }
.switch input:focus-visible + .track {
  box-shadow: 0 0 0 3px rgba(18,199,178,.32); }
.pergrid { display: grid; grid-template-columns: repeat(4, 1fr);
  gap: .3rem .45rem; margin: .3rem 0 .1rem; }
.pergrid.cols2 { grid-template-columns: repeat(2, 1fr); }
.pcell { display: flex; align-items: center; gap: .4rem;
  padding: 2px 6px; border-radius: var(--r-md); }
.pcell .tglabel { font-size: .78rem; }
@keyframes glowwrap {
  0%,100% { box-shadow: 0 0 0 0 rgba(245,165,36,0); }
  50% { box-shadow: 0 0 16px 2px rgba(245,165,36,.32); }
}
.pcell.flash { animation: glowwrap 2.2s ease-in-out infinite;
  background: rgba(245,165,36,.06); }
.pcell.flash .tglabel { color: var(--amber); }

/* ---------- picker (searchable multiselect) ---------- */
.picker-tags { display: flex; flex-wrap: wrap; gap: .35rem;
  margin: .4rem 0; }
.tag { display: inline-flex; align-items: center; gap: .35rem;
  background: linear-gradient(180deg, #0C2B28, #08201E);
  border: 1px solid rgba(183,143,46,.55); color: #EBDCA8;
  border-radius: var(--r-pill); padding: .28rem .65rem;
  font-size: .78rem; font-weight: 600; }
.tag button { all: unset; cursor: pointer; color: #EBDCA8;
  font-weight: 800; padding: 0 .1rem; }
.picker-list { background: var(--raise);
  border: 1px solid var(--hairline); border-radius: var(--r-md);
  max-height: 265px; overflow-y: auto; margin-top: .3rem; }
.picker-item { padding: .6rem .8rem; font-size: .85rem;
  cursor: pointer; border-bottom: 1px solid #202839; }
.picker-item:last-child { border-bottom: none; }
.picker-item:hover, .picker-item:active { background: #232C41; }
.picker-item .fee { color: var(--ink-faint); font-size: .75rem; }
.picker-empty { padding: .7rem .8rem; color: var(--ink-faint);
  font-size: .8rem; }

/* ---------- sections / modal / toast ---------- */
.section { border: 1px solid var(--hairline); border-radius: var(--r-md);
  padding: .75rem .85rem; margin: .7rem 0; }
.section > summary { cursor: pointer; font-weight: 600;
  color: var(--ink-dim); font-size: .88rem; }
.section[open] > summary { color: var(--teal);
  margin-bottom: .5rem; }
.modal-back { position: fixed; inset: 0; background: rgba(5,7,12,.72);
  display: flex; align-items: center; justify-content: center;
  padding: calc(1rem + env(safe-area-inset-top)) 1rem
           calc(1rem + env(safe-area-inset-bottom)); z-index: 50; }
.modal { background: var(--card); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); padding: 1.1rem 1.1rem .9rem;
  width: 100%; max-width: 400px;
  box-shadow: 0 24px 60px rgba(0,0,0,.55); }
.modal h3 { margin: 0 0 .5rem; font-family: var(--display);
  font-size: 1.1rem; }
.toast { position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(1.2rem + env(safe-area-inset-bottom));
  background: var(--raise); border: 1px solid var(--hairline);
  color: var(--ink); border-radius: var(--r-pill);
  padding: .55rem 1.1rem; font-size: .82rem; font-weight: 600;
  z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.5);
  opacity: 0; transition: opacity .25s; pointer-events: none; }
.toast.show { opacity: 1; }
.toast.bad { border-color: rgba(224,86,79,.5); color: #ff9d96; }
.empty-note { font-size: .83rem; color: var(--ink-dim);
  margin-top: .9rem; }
.searchbar { margin: .35rem 0 .1rem; }
.savedot { display:inline-block; width:8px; height:8px;
  border-radius:50%; background: var(--mint); margin-left:.4rem;
  vertical-align: middle; transition: background .2s; }
.savedot.saving { background: var(--teal); }
.savedot.bad { background: var(--signal); }
.spacer { height: .6rem; }
hr.thin { border: none; border-top: 1px solid var(--hairline);
  margin: .8rem 0; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- in-card actions row ---------- */
.bc-foot { display: flex; align-items: center; gap: .5rem;
  flex-wrap: wrap; margin-top: .6rem; padding-top: .55rem;
  border-top: 1px solid var(--hairline); }
.bc-toggle { flex: 1 1 auto; min-width: 0; }
.bc-toggle .tgrow, .bc-toggle .pergrid { margin: 0; }
.bc-x { flex: 0 0 auto; margin: 0 0 0 auto; width: 34px; height: 34px;
  min-height: 34px; padding: 0; border-radius: 50%;
  background: transparent; border: 1px solid var(--hairline);
  color: var(--ink-faint); font-size: 1.15rem; font-weight: 600;
  line-height: 1; box-shadow: none; }
.bc-x:hover { background: rgba(224,86,79,.12); color: var(--signal);
  border-color: rgba(224,86,79,.5); transform: none; filter: none; }
.benefit-card.used .bc-x { opacity: .8; }

/* ---------- removed-benefit restore rows ---------- */
.hidrow { display: flex; align-items: center; gap: .6rem;
  padding: .5rem 0; border-bottom: 1px solid #202839; }
.hidrow:last-of-type { border-bottom: none; }
.hidname { flex: 1 1 auto; font-size: .85rem; font-weight: 600;
  line-height: 1.3; }
.hidcard { font-size: .68rem; font-weight: 600; letter-spacing: .09em;
  text-transform: uppercase; color: var(--teal-deep);
  margin-top: .15rem; }
.hidbtn { flex: 0 0 auto; width: auto; min-height: 36px;
  padding: .35rem .8rem; font-size: .78rem; margin: 0; }

/* ---------- stackNtrack wordmark ---------- */
/* Horizontal lockup. "track" carries a touch of extra letter-spacing
   because r and t are narrow in Space Grotesk - without it the second
   word optically reads smaller than the first. */
.wordmark { display: inline-flex; align-items: baseline;
  white-space: nowrap; font-family: var(--display); font-weight: 700;
  line-height: 1; margin-top: .8rem;
  font-size: clamp(1.7rem, 8.5vw, 2.15rem); }
.wm-1 { color: var(--blue); letter-spacing: -.02em; }
.wm-2 { color: var(--silver); letter-spacing: -.01em; }
.wm-3 { color: var(--teal); letter-spacing: .012em; }
.wm-inline { display: inline-flex; align-items: baseline;
  white-space: nowrap; font-family: var(--display); font-weight: 700;
  font-size: 1.42rem; line-height: 1; }
.wm-inline .a { color: var(--blue); letter-spacing: -.02em; }
.wm-inline .n { color: var(--silver); letter-spacing: -.01em; }
.wm-inline .b { color: var(--teal); letter-spacing: .012em; }

/* ---------- value progress ---------- */
.vwrap { margin: .55rem 0 .1rem; }
.vbar { height: 6px; border-radius: var(--r-pill); background: #1D2434;
  border: 1px solid var(--hairline); overflow: hidden; }
.vbar > i { display: block; height: 100%; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--teal), var(--blue));
  transition: width .25s ease; }
.vlab { font-size: .72rem; color: var(--ink-dim); margin-top: .3rem;
  line-height: 1.35; }
.vlab b { color: var(--teal); font-weight: 700; }
.vlab.solo { margin-top: .5rem; }
.card-hero .vwrap { margin-top: .7rem; }
.benefit-card.used .vbar > i { filter: grayscale(.6); }

.pill.period { color: var(--amber); font-weight: 700;
  border-color: rgba(245,165,36,.5); background: rgba(245,165,36,.08); }

/* ---------- notes ---------- */
.note, .pinned { display: flex; align-items: flex-start; gap: .45rem;
  margin-top: .55rem; padding: .5rem .6rem; border-radius: var(--r-md);
  background: rgba(78,143,245,.07);
  border: 1px solid rgba(78,143,245,.22);
  font-size: .78rem; line-height: 1.4; color: var(--ink);
  cursor: pointer; transition: border-color .15s, background .15s; }
.note:hover, .pinned:hover { background: rgba(78,143,245,.11);
  border-color: rgba(78,143,245,.42); }
.note-pin { flex: 0 0 auto; opacity: .75; font-size: .8rem;
  line-height: 1.45; }
.note-text { flex: 1 1 auto; min-width: 0; word-break: break-word; }
.note-edit { flex: 0 0 auto; opacity: .5; font-size: .75rem; }
.pinned { margin-top: .7rem; background: rgba(18,199,178,.08);
  border-color: rgba(18,199,178,.28); }
.pinned:hover { background: rgba(18,199,178,.13);
  border-color: rgba(18,199,178,.5); }
.benefit-card.used .note { opacity: .6; }

.addnote { width: auto; min-height: 34px; margin: .7rem 0 0;
  padding: .3rem .7rem; font-size: .73rem; font-weight: 600;
  background: transparent; color: var(--ink-faint);
  border: 1px dashed var(--hairline); box-shadow: none;
  border-radius: var(--r-pill); }
.addnote:hover { color: var(--teal); border-color: rgba(18,199,178,.5);
  background: rgba(18,199,178,.06); transform: none; filter: none; }

.bc-note { flex: 0 0 auto; margin: 0 0 0 auto; width: 34px; height: 34px;
  min-height: 34px; padding: 0; border-radius: 50%;
  background: transparent; border: 1px solid var(--hairline);
  color: var(--ink-faint); font-size: 1rem; font-weight: 600;
  line-height: 1; box-shadow: none; }
.bc-note:hover { background: rgba(78,143,245,.14); color: var(--blue);
  border-color: rgba(78,143,245,.5); transform: none; filter: none; }
.bc-foot .bc-x { margin-left: .4rem; }

/* ---------- note editor ---------- */
.notebox { width: 100%; background: var(--card); color: var(--ink);
  border: 1px solid var(--hairline); border-radius: var(--r-md);
  padding: .7rem .85rem; font-size: 16px; font-family: var(--ui);
  line-height: 1.45; outline: none; resize: none; margin-top: .5rem;
  transition: border-color .15s, box-shadow .15s; }
.notebox:focus { border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(18,199,178,.18); }
.notebox::placeholder { color: var(--ink-faint); }
.notecount { text-align: right; font-size: .68rem; color: var(--ink-faint);
  margin: .25rem .1rem .55rem; font-variant-numeric: tabular-nums; }

/* ---------- card hero tagline ---------- */
.h-tag { font-family: var(--display); font-weight: 500; font-size: .84rem;
  color: var(--teal); margin-top: .15rem; letter-spacing: .01em; }

/* ---------- settings gear ---------- */
.brand { position: relative; }
.gear { flex: 0 0 auto; margin: 0 0 0 auto; width: 40px; height: 40px;
  min-height: 40px; padding: 0; border-radius: 50%;
  background: var(--card); border: 1px solid var(--hairline);
  color: var(--ink-dim); font-size: 1.15rem; line-height: 1;
  box-shadow: none; align-self: center; }
.gear:hover { color: var(--teal); border-color: rgba(18,199,178,.5);
  transform: none; filter: none; }

/* ---------- settings sheet ---------- */
.modal.sheet { max-width: 440px; max-height: 88vh; padding: 0;
  display: flex; flex-direction: column; overflow: hidden; }
.sheet-head { display: flex; align-items: center; gap: .6rem;
  padding: 1rem 1.1rem .75rem; border-bottom: 1px solid var(--hairline);
  flex: 0 0 auto; }
.sheet-head h3 { margin: 0; flex: 1 1 auto; }
.sheet-x { flex: 0 0 auto; width: 34px; height: 34px; min-height: 34px;
  padding: 0; margin: 0; border-radius: 50%; background: transparent;
  border: 1px solid var(--hairline); color: var(--ink-dim);
  font-size: 1.2rem; line-height: 1; box-shadow: none; }
.sheet-x:hover { color: var(--ink); transform: none; filter: none; }
.sheet-body { flex: 1 1 auto; overflow-y: auto; padding: .35rem 1.1rem 1rem;
  -webkit-overflow-scrolling: touch; }
.set-sec { padding: .85rem 0; border-bottom: 1px solid var(--hairline); }
.set-sec:last-child { border-bottom: none; }
.set-lab { font-size: .66rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--teal-deep); margin-bottom: .4rem; }

/* ---------- help accordion ---------- */
.qa { border: 1px solid var(--hairline); border-radius: var(--r-md);
  margin: .35rem 0; background: var(--raise); }
.qa > summary { cursor: pointer; padding: .6rem .75rem; font-size: .84rem;
  font-weight: 600; color: var(--ink-dim); list-style: none; }
.qa > summary::-webkit-details-marker { display: none; }
.qa > summary::after { content: "+"; float: right; color: var(--ink-faint);
  font-weight: 700; }
.qa[open] > summary { color: var(--teal); }
.qa[open] > summary::after { content: "\2212"; }
.qa-a { padding: 0 .75rem .7rem; font-size: .79rem; line-height: 1.55;
  color: var(--ink-dim); }

/* ---------- drag to reorder ---------- */
.benefit-card.draggable { position: relative; padding-left: 1.85rem; }
.bc-grip { position: absolute; left: .3rem; top: .55rem; bottom: .55rem;
  width: 1.3rem; display: flex; align-items: center; justify-content: center;
  color: var(--ink-faint); font-size: .8rem; letter-spacing: -.18em;
  cursor: grab; touch-action: none; user-select: none;
  -webkit-user-select: none; border-radius: var(--r-md);
  transition: color .15s, background .15s; }
.bc-grip:hover { color: var(--teal); background: rgba(18,199,178,.07); }
.benefit-card.dragging { opacity: .93; cursor: grabbing;
  border-color: var(--teal); box-shadow: 0 14px 34px rgba(0,0,0,.5),
  0 0 0 1px rgba(18,199,178,.35); z-index: 20; position: relative; }
.benefit-card.dragging .bc-grip { color: var(--teal); cursor: grabbing; }
.benefit-list.dragging-active .benefit-card:not(.dragging) {
  transition: transform .18s ease; }
.benefit-list.dragging-active { cursor: grabbing; }

/* ---------- generated card art ----------
   Original monograms in issuer-associated colours. Deliberately not
   brand logos: those are trademarked and cannot ship in a published
   app. */
.cart { display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; border-radius: 5px; font-family: var(--display);
  font-weight: 700; letter-spacing: .01em; overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28),
              inset 0 -1px 0 rgba(0,0,0,.20),
              0 1px 3px rgba(0,0,0,.4); }
/* a faint diagonal sheen so metal cards read as metal */
.cart::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, rgba(255,255,255,.30) 0%,
    rgba(255,255,255,0) 42%, rgba(0,0,0,.12) 100%);
  pointer-events: none; }
.cart.xs { width: 22px; height: 15px; font-size: .55rem; margin-right: .4rem;
  vertical-align: -2px; }
.cart.sm { width: 30px; height: 20px; font-size: .62rem; margin-right: .55rem; }
.cart.lg { width: 46px; height: 30px; font-size: .82rem; border-radius: 7px; }

.picker-item { display: flex; align-items: center; }
.pi-name { flex: 1 1 auto; min-width: 0; }
.chip { display: inline-flex; align-items: center; }
.h-top { display: flex; align-items: center; gap: .6rem; }
.h-top .h-name { flex: 1 1 auto; min-width: 0; }

/* ============================================================
   v3.0 refinement pass
   Spacing rhythm: 4 / 8 / 12 / 16 / 20 / 24
   Principle: tighten INSIDE cards, loosen BETWEEN them. The old
   build did the opposite, which made a filtered list read as one
   undifferentiated slab.
   ============================================================ */
:root {
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px;
  --ease: cubic-bezier(.2,.8,.3,1);
}

/* ---------- header ---------- */
.brand { gap: var(--s3); margin: var(--s1) 0 var(--s4); }
.brand-icon { width: 40px; height: 40px; border-radius: 10px; }
.brand-tag { font-size: .74rem; margin-top: var(--s1);
  letter-spacing: .01em; }
.gear { width: 40px; height: 40px; min-height: 40px;
  background: transparent; border: 1px solid var(--hairline);
  transition: color .15s var(--ease), border-color .15s var(--ease),
              background .15s var(--ease); }
.gear:active { transform: scale(.94); }
#app > .hint:first-of-type { margin: 0 0 var(--s4); }

/* ---------- summary: one surface, not three boxes ---------- */
.statbar { background: linear-gradient(180deg, #141B29, #111724);
  border: 1px solid var(--hairline); border-radius: var(--r-lg);
  overflow: hidden; margin: 0 0 var(--s5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045),
              0 2px 10px rgba(0,0,0,.30); }
.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); }
.stat { padding: var(--s4) var(--s2) var(--s3);
  text-align: center; position: relative; }
.stat + .stat::before { content: ""; position: absolute; left: 0;
  top: 22%; bottom: 22%; width: 1px; background: var(--hairline); }
.stat-num { font-family: var(--display); font-weight: 700;
  font-size: 1.35rem; line-height: 1.1; letter-spacing: -.02em; }
.stat-num.green { color: #4FD08A; }
.stat-num.amber { color: var(--amber); }
.stat-lab { font-size: .62rem; color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: .11em; font-weight: 700;
  margin-top: var(--s1); }
.statprog { padding: 0 var(--s4) var(--s3);
  border-top: 1px solid var(--hairline); padding-top: var(--s3); }
.statprog .vwrap { margin: 0; }

/* ---------- filter chips ---------- */
.strip { gap: var(--s2); padding: 0 2px var(--s4); }
.chip { min-height: 44px; padding: 0 var(--s3); border-radius: 11px;
  border-top-width: 2px; font-size: .82rem;
  transition: color .15s var(--ease), background .15s var(--ease),
              border-color .15s var(--ease); }
.chip.active { background: rgba(18,199,178,.10);
  border-color: rgba(18,199,178,.30);
  border-top-color: var(--teal); color: var(--teal); }
.chip.warn { border-top-color: rgba(245,165,36,.55); }
.chip.warn.active { background: rgba(245,165,36,.12);
  border-color: rgba(245,165,36,.38); border-top-color: var(--amber);
  color: var(--amber); }
.chipbadge { display: inline-flex; align-items: center;
  justify-content: center; min-width: 20px; height: 20px;
  margin-left: var(--s2); padding: 0 5px; border-radius: 999px;
  background: rgba(245,165,36,.18); color: var(--amber);
  font-size: .7rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.chip.active .chipbadge { background: rgba(245,165,36,.26); }

/* ---------- benefit card ---------- */
.benefit-list { display: flex; flex-direction: column; gap: var(--s5); }
.benefit-card { margin: 0; padding: 0; overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(180deg, #161D2B 0%, #131926 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04),
              0 2px 8px rgba(0,0,0,.28);
  transition: transform .12s var(--ease), border-color .15s var(--ease),
              opacity .22s var(--ease); }
.benefit-card.draggable { padding-left: 0; }
.bc-body { padding: var(--s4); }
.benefit-card.urgent { border-left: none; position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04),
              0 4px 16px rgba(245,165,36,.10),
              0 2px 8px rgba(0,0,0,.28); }
.benefit-card.urgent::before { content: ""; position: absolute;
  left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--amber),
              rgba(245,165,36,.35)); }
.benefit-card.urgent .bc-body { padding-left: calc(var(--s4) + 4px); }
.benefit-card.used { opacity: .55; filter: none; }
.benefit-card.used .bc-value { color: var(--ink-faint);
  text-decoration: line-through; text-shadow: none; }
@media (hover:hover) {
  .benefit-card:hover { transform: translateY(-1px); }
}
.benefit-card:active { transform: scale(.995); }

.bc-issuer { display: flex; align-items: center; font-size: .64rem;
  font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: var(--s3); }
.bc-head { display: flex; align-items: baseline; gap: var(--s3);
  margin-bottom: var(--s2); }
.bc-name { flex: 1 1 auto; min-width: 0; font-size: 1rem;
  font-weight: 700; line-height: 1.3; letter-spacing: -.005em; }
.bc-value { flex: 0 0 auto; font-family: var(--display);
  font-weight: 700; font-size: 1.6rem; line-height: 1;
  color: var(--teal); letter-spacing: -.02em; white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255,255,255,.10),
               0 -1px 0 rgba(0,0,0,.5); }

.bc-chips { display: flex; flex-wrap: wrap; gap: var(--s2);
  margin-bottom: var(--s3); }
.chip.quiet, .bc-chips .chip { min-height: 0; }
.bc-chips .chip { padding: 3px 9px; border-radius: 999px;
  font-size: .7rem; font-weight: 600; background: #1B2333;
  border: 1px solid var(--hairline); color: var(--ink-dim);
  border-top-width: 1px; }
.bc-chips .chip.quiet { background: transparent; color: var(--ink-faint); }
.bc-chips .chip.urgent-chip { background: rgba(245,165,36,.14);
  border-color: rgba(245,165,36,.42); color: var(--amber);
  font-weight: 800; letter-spacing: .01em; }
.bc-chips .chip.expired { background: rgba(224,86,79,.14);
  border-color: rgba(224,86,79,.4); color: var(--signal);
  font-weight: 800; }

.bc-desc { font-size: .78rem; line-height: 1.5; color: var(--ink-faint);
  margin-bottom: var(--s3); display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }

.bc-body .vwrap { margin: 0 0 var(--s3); }
.bc-body .vlab { font-size: .73rem; }

/* ---------- action row ---------- */
.bc-foot { margin-top: 0; padding-top: var(--s3);
  border-top: 1px solid var(--hairline); gap: var(--s2); }
.bc-icon { flex: 0 0 auto; width: 36px; height: 36px; min-height: 36px;
  margin: 0; padding: 0; border-radius: 50%; background: transparent;
  border: 1px solid var(--hairline); color: var(--ink-faint);
  font-size: 1rem; font-weight: 600; line-height: 1; box-shadow: none;
  transition: color .15s var(--ease), background .15s var(--ease),
              border-color .15s var(--ease); }
.bc-icon:hover { color: var(--blue); background: rgba(78,143,245,.12);
  border-color: rgba(78,143,245,.45); transform: none; filter: none; }
.bc-icon:active { transform: scale(.92); }
.bc-icon.danger:hover { color: var(--signal);
  background: rgba(224,86,79,.12); border-color: rgba(224,86,79,.45); }
.bc-foot .bc-icon:nth-of-type(1) { margin-left: auto; }

/* ---------- the mark-used control ---------- */
.markbtn { display: inline-flex; align-items: center; gap: var(--s2);
  padding: 9px var(--s3) 9px 10px; border-radius: 999px;
  background: #1B2333; border: 1px solid var(--hairline);
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: background .18s var(--ease), border-color .18s var(--ease),
              color .18s var(--ease); }
.markbtn input { position: absolute; opacity: 0; width: 0; height: 0; }
.markdot { width: 17px; height: 17px; border-radius: 50%;
  border: 1.5px solid var(--ink-faint); flex: 0 0 auto;
  position: relative;
  transition: border-color .18s var(--ease),
              background .18s var(--ease); }
.markdot::after { content: ""; position: absolute; left: 4.5px;
  top: 1.5px; width: 4px; height: 8px; border: solid #04211D;
  border-width: 0 2px 2px 0; transform: rotate(45deg) scale(.4);
  opacity: 0; transition: opacity .18s var(--ease),
                          transform .18s var(--ease); }
.marktext { font-size: .8rem; font-weight: 700; color: var(--ink-dim);
  letter-spacing: -.005em; }
.markbtn:active { transform: scale(.97); }
.markbtn.on { background: rgba(18,199,178,.13);
  border-color: rgba(18,199,178,.42); }
.markbtn.on .markdot { background: var(--teal); border-color: var(--teal); }
.markbtn.on .markdot::after { opacity: 1; transform: rotate(45deg) scale(1); }
.markbtn.on .marktext { color: var(--teal); }
@media (hover:hover) {
  .markbtn:hover { border-color: rgba(18,199,178,.35); }
  .markbtn:hover .marktext { color: var(--ink); }
}

/* period grid on card tabs keeps the small switches, tightened */
.bc-toggle .pergrid { gap: var(--s2) var(--s3); margin: 0; }
.bc-toggle { flex: 1 1 auto; min-width: 0; }

/* ---------- progress ---------- */
.vbar { height: 5px; background: #1B2333; }
.vbar > i { transition: width .4s var(--ease); }
.vlab { margin-top: var(--s2); }

/* ---------- card hero ---------- */
.card-hero { padding: var(--s4); margin: 0 0 var(--s5);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045),
              0 2px 10px rgba(0,0,0,.30); }
.h-top { gap: var(--s3); }
.h-name { font-size: 1.14rem; letter-spacing: -.015em; }
.h-meta { margin-top: var(--s1); font-size: .73rem; }
.h-stats { margin-top: var(--s3); font-size: .76rem; }

/* ---------- search ---------- */
.searchbar { margin: 0 0 var(--s3); }
.searchbar input { padding: .68rem .9rem; }

/* ---------- calmer urgency pulse ---------- */
@keyframes pulsewarn {
  0%,100% { opacity: 1; }
  50% { opacity: .62; }
}
.expires-soon { animation: pulsewarn 3s ease-in-out infinite; }
.pcell.flash { animation: none; background: rgba(245,165,36,.07);
  border: 1px solid rgba(245,165,36,.22); }

.empty-note { padding: var(--s5) var(--s4); text-align: center;
  background: var(--card); border: 1px solid var(--hairline);
  border-radius: 16px; margin-top: 0; }

/* ============================================================
   v3.1 corrections
   - every :hover guarded, because on touch screens :hover STICKS
     after a tap (this is what turned the remove buttons red)
   - one interaction language: tap a pill, it fills teal
   - a captured credit should read as an achievement, not a
     disabled row
   ============================================================ */

/* ---------- kill sticky hover on touch ---------- */
.bc-icon:hover, .bc-icon.danger:hover, .gear:hover {
  color: var(--ink-faint); background: transparent;
  border-color: var(--hairline); }
@media (hover: hover) and (pointer: fine) {
  .bc-icon:hover { color: var(--blue); background: rgba(78,143,245,.12);
    border-color: rgba(78,143,245,.45); }
  .bc-icon.danger:hover { color: var(--signal);
    background: rgba(224,86,79,.12); border-color: rgba(224,86,79,.45); }
  .gear:hover { color: var(--teal);
    border-color: rgba(18,199,178,.5); background: transparent; }
}
/* the remove control is quiet until deliberately pressed */
.bc-icon.danger { color: var(--ink-faint); }
.bc-icon.danger:active { color: var(--signal);
  background: rgba(224,86,79,.14); border-color: rgba(224,86,79,.5); }

/* ---------- period chips: one language with the mark button ---------- */
.pergrid { display: grid; gap: var(--s2); margin: 0; width: 100%; }
.pergrid.n12 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pergrid.n4  { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pergrid.n2  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.perchip { position: relative; display: flex; align-items: center;
  justify-content: center; min-height: 38px; padding: 0 var(--s1);
  border-radius: 10px; background: #1B2333;
  border: 1px solid var(--hairline); cursor: pointer;
  user-select: none; -webkit-user-select: none;
  font-size: .78rem; font-weight: 700; color: var(--ink-dim);
  letter-spacing: -.005em;
  transition: background .18s var(--ease), border-color .18s var(--ease),
              color .18s var(--ease), transform .1s var(--ease); }
.perchip input { position: absolute; opacity: 0; width: 0; height: 0; }
.perchip:active { transform: scale(.95); }
.perchip.now { border-color: rgba(245,165,36,.45);
  box-shadow: inset 0 0 0 1px rgba(245,165,36,.14); }
.perchip.on { background: rgba(18,199,178,.16);
  border-color: rgba(18,199,178,.5); color: var(--teal); }
.perchip.on.now { border-color: rgba(18,199,178,.6); box-shadow: none; }
.perchip.on span::before { content: "\2713\00a0"; font-weight: 800; }

/* ---------- captured state: rewarding, not switched off ---------- */
.benefit-card.used { opacity: 1; filter: none;
  background: linear-gradient(180deg,
    rgba(18,199,178,.075) 0%, rgba(18,199,178,.025) 100%);
  border-color: rgba(18,199,178,.30);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05),
              0 2px 10px rgba(0,0,0,.26); }
.benefit-card.used::before { content: ""; position: absolute; left: 0;
  top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--teal),
              rgba(18,199,178,.35)); }
.benefit-card.used .bc-body { padding-left: calc(var(--s4) + 4px); }
.benefit-card.used .bc-value { color: var(--teal);
  text-decoration: none;
  text-shadow: 0 0 18px rgba(18,199,178,.35),
               0 1px 0 rgba(255,255,255,.10); }
.benefit-card.used .bc-name { color: var(--ink); }
.benefit-card.used .bc-desc { color: var(--ink-faint); }
/* a captured credit is no longer urgent - teal wins over amber */
.benefit-card.used.urgent::before {
  background: linear-gradient(180deg, var(--teal),
              rgba(18,199,178,.35)); }
.benefit-card.used .chip.urgent-chip { background: rgba(18,199,178,.12);
  border-color: rgba(18,199,178,.35); color: var(--teal); }
.captured { color: var(--teal); font-weight: 700; }

/* ---------- descriptions: readable again ---------- */
.bc-desc { display: block; -webkit-line-clamp: none; overflow: visible;
  font-size: .8rem; line-height: 1.55; color: var(--ink-dim);
  margin-bottom: var(--s3); }

/* ---------- separation so rows stop bleeding together ---------- */
.benefit-card { border: 1px solid var(--hairline); }
.bc-issuer { padding-bottom: var(--s2);
  border-bottom: 1px solid rgba(255,255,255,.04); }
.bc-head { margin-top: var(--s3); }
.bc-foot { margin-top: var(--s3); padding-top: var(--s3);
  align-items: center; }
.bc-toggle { flex: 1 1 100%; min-width: 0; }
/* on a card tab the grid needs the full width, so actions wrap below */
.benefit-card.draggable .bc-foot { flex-wrap: wrap; row-gap: var(--s3); }
.benefit-card.draggable .bc-foot .bc-icon:nth-of-type(1) {
  margin-left: auto; }

/* alerts view keeps the single control inline with the icons */
.benefit-card:not(.draggable) .bc-toggle { flex: 1 1 auto; }

/* ---------- the mark button, slightly larger tap area ---------- */
.markbtn { min-height: 40px; padding: 0 var(--s4) 0 12px; }

/* ============================================================
   v3.2
   - the remove control is neutral, full stop
   - tiles read as miniature cards: chip, band, then monogram
   ============================================================ */

/* ---------- remove button: never red unless pressed ---------- */
.bc-icon, .bc-icon:hover, .bc-icon:focus, .bc-icon.danger {
  color: var(--ink-faint); background: transparent;
  border-color: var(--hairline); }
.bc-icon:active { background: rgba(255,255,255,.06); color: var(--ink-dim);
  border-color: var(--hairline); }
@media (hover: hover) and (pointer: fine) {
  .bc-icon:hover { color: var(--ink-dim);
    background: rgba(255,255,255,.05);
    border-color: rgba(255,255,255,.14); }
}

/* ---------- tiles as miniature cards ---------- */
.cart { position: relative; justify-content: flex-end;
  align-items: flex-end; padding: 0 3px 1px 0; }
/* the chip - the single detail that makes a rectangle read as a card */
.cart::before { content: ""; position: absolute; left: 15%; top: 24%;
  width: 22%; height: 26%; border-radius: 1.5px;
  background: linear-gradient(140deg, rgba(255,255,255,.92),
              rgba(255,255,255,.55));
  box-shadow: 0 0 0 .5px rgba(0,0,0,.18); z-index: 1; }
/* a soft band across the lower third, as most cards carry */
.cart::after { background:
  linear-gradient(118deg, rgba(255,255,255,.26) 0%,
    rgba(255,255,255,.04) 38%, rgba(255,255,255,0) 52%,
    rgba(0,0,0,.16) 100%),
  linear-gradient(0deg, rgba(0,0,0,.14) 0 26%, rgba(0,0,0,0) 26%); }
.cart { font-size: .5rem !important; letter-spacing: .02em; }
.cart.xs { width: 26px; height: 17px; font-size: .42rem !important; }
.cart.sm { width: 34px; height: 22px; font-size: .5rem !important; }
.cart.lg { width: 52px; height: 33px; font-size: .66rem !important;
  border-radius: 8px; padding: 0 5px 2px 0; }
.cart.lg::before { border-radius: 2.5px; }

/* dark tiles need a lighter chip, light tiles a darker one */
.cart[data-ink="dark"]::before {
  background: linear-gradient(140deg, rgba(0,0,0,.42), rgba(0,0,0,.18)); }

/* ---------- settings link ---------- */
.setlink { display: inline-block; margin-top: var(--s2);
  font-size: .82rem; font-weight: 600; color: var(--blue);
  text-decoration: none; }
.setlink:hover { text-decoration: underline; }

/* ---------- destructive settings action ---------- */
.danger-text { color: #ff9d96 !important;
  border-color: rgba(224,86,79,.32) !important; }
.danger-text:active { background: rgba(224,86,79,.14) !important; }
@media (hover: hover) and (pointer: fine) {
  .danger-text:hover { color: #ffb3ad !important;
    border-color: rgba(224,86,79,.5) !important;
    background: rgba(224,86,79,.08) !important; }
}

/* ---------- earn rates: "Read more" on each card ---------- */
.earn-summary { font-size: .82rem; line-height: 1.5; color: var(--ink-dim);
  margin: var(--s2) 0 0; }
.earn-qa { margin: var(--s3) 0 0; background: transparent;
  border: none; border-top: 1px solid var(--hairline);
  border-radius: 0; padding-top: var(--s3); }
.earn-qa > summary { display: flex; align-items: center;
  justify-content: space-between; gap: var(--s2);
  color: var(--teal); font-size: .74rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; padding: 0; }
.earn-qa > summary::after { content: "+"; float: none;
  color: var(--teal); font-size: .95rem; }
.earn-qa[open] > summary::after { content: "\2212"; }
.earn-qa[open] > summary { color: var(--teal); }
.qa-cur { font-weight: 600; letter-spacing: .01em; text-transform: none;
  color: var(--ink-faint); font-size: .68rem; }
.earn-qa .qa-a { padding: var(--s3) 0 0; }

ul.rates { list-style: none; margin: 0; padding: 0; }
ul.rates li { display: flex; gap: var(--s3); padding: var(--s2) 0;
  border-bottom: 1px solid var(--hairline); }
ul.rates li:last-child { border-bottom: none; }
.rt { font-family: var(--display); font-weight: 700; font-size: .84rem;
  color: var(--teal); min-width: 40px; flex: 0 0 auto;
  font-variant-numeric: tabular-nums; }
.rt.none { color: var(--ink-faint); }
.rd { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ron { font-size: .8rem; line-height: 1.4; color: var(--ink); }
.rcap { font-size: .7rem; color: var(--amber); line-height: 1.3; }
.earn-notes { margin: var(--s3) 0 0; font-size: .74rem; line-height: 1.55;
  color: var(--ink-faint); border-left: 2px solid var(--hairline);
  padding-left: var(--s3); }
