/* Saga Member V30 — Reward Pocket */
.v30-reward-pocket {
  position: relative;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 0 14px;
  margin: 14px 12px 18px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid rgb(24 20 17 / 13%);
  border-radius: 24px;
  background: #fffaf0;
  box-shadow: 0 14px 32px rgb(43 27 22 / 10%);
  color: #181411;
}

.v30-reward-pocket::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: #c9ef72;
  content: "";
}

.v30-reward-pocket-ticket {
  display: grid;
  min-height: 116px;
  place-items: center;
  border-radius: 17px;
  background: #2b1b16;
  color: #fff8ed;
}

.v30-reward-pocket-ticket span {
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.v30-reward-pocket-ticket i {
  width: 23px;
  border-top: 1px dashed rgb(255 248 237 / 45%);
}

.v30-reward-pocket-ticket strong {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.v30-reward-pocket-copy {
  min-width: 0;
}

.v30-reward-pocket-copy .eyebrow {
  margin: 2px 0 5px;
  color: #68412f;
  font-size: 0.6875rem;
}

.v30-reward-pocket-copy h2 {
  max-width: 15ch;
  margin: 0;
  font-size: clamp(1.25rem, 5.8vw, 1.55rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.v30-reward-pocket-copy > p:last-of-type {
  margin: 8px 0 0;
  color: #554b45;
  font-size: 0.78rem;
  line-height: 1.45;
}

.v30-reward-pocket-state {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
  color: #23452f;
  font-size: 0.72rem;
  font-weight: 750;
}

.v30-reward-pocket-state .feather-icon {
  flex: 0 0 auto;
}

.v30-reward-pocket-steps {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px dashed rgb(24 20 17 / 19%);
}

.v30-reward-pocket-steps span {
  display: grid;
  gap: 5px;
  color: #6c635d;
  font-size: 0.69rem;
  font-weight: 650;
  line-height: 1.25;
}

.v30-reward-pocket-steps b {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  background: #e8f6c8;
  color: #23452f;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.v30-reward-pocket-note {
  grid-column: 1 / -1;
  margin: 12px 0 0;
  color: #6c635d;
  font-size: 0.75rem;
  line-height: 1.45;
}

.v30-reward-pocket-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 8px;
  margin-top: 12px;
}

.v30-reward-pocket-actions .button {
  min-width: 0;
  min-height: 46px;
  padding-inline: 10px;
  font-size: 0.76rem;
  white-space: normal;
}

.v30-reward-pocket-dialog {
  width: min(calc(100% - 24px), 406px);
  max-width: none;
  margin: auto auto max(12px, env(safe-area-inset-bottom));
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 28px;
  background: transparent;
  color: #181411;
}

.v30-reward-pocket-dialog::backdrop {
  background: rgb(24 20 17 / 72%);
  backdrop-filter: blur(5px);
}

.v30-reward-pocket-panel {
  position: relative;
  box-sizing: border-box;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  border: 1px solid rgb(255 255 255 / 52%);
  border-radius: 28px;
  background: #fffaf0;
  box-shadow: 0 28px 80px rgb(24 20 17 / 28%);
}

.v30-reward-pocket-handle {
  width: 42px;
  height: 4px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: rgb(24 20 17 / 20%);
}

.v30-reward-pocket-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
}

.v30-reward-pocket-panel > .eyebrow {
  margin: 2px 50px 6px 0;
  color: #68412f;
}

.v30-reward-pocket-panel h2 {
  max-width: 14ch;
  margin: 0;
  font-size: clamp(1.65rem, 7.4vw, 2rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.v30-reward-pocket-stamp {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 18px;
  padding: 14px;
  border: 2px solid #bd4f2f;
  border-radius: 18px;
  color: #9c3c25;
  transform: rotate(-1deg);
}

.v30-reward-pocket-stamp span {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.v30-reward-pocket-stamp strong {
  padding-left: 12px;
  border-left: 1px dashed currentColor;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  line-height: 1.25;
}

.v30-reward-pocket-meta {
  display: grid;
  gap: 0;
  margin: 18px 0 0;
}

.v30-reward-pocket-meta div {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgb(24 20 17 / 10%);
}

.v30-reward-pocket-meta dt {
  color: #6c635d;
  font-size: 0.75rem;
}

.v30-reward-pocket-meta dd {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: right;
}

.v30-reward-pocket-dialog-note {
  margin: 14px 0;
  color: #554b45;
  font-size: 0.78rem;
  line-height: 1.5;
}

.v30-reward-pocket-finish {
  min-height: 52px;
}

@media (max-width: 350px) {
  .v30-reward-pocket { grid-template-columns: 58px minmax(0, 1fr); gap: 0 11px; padding: 12px; }
  .v30-reward-pocket-ticket { min-height: 110px; }
  .v30-reward-pocket-actions { grid-template-columns: 1fr; }
  .v30-reward-pocket-actions .button { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .v30-reward-pocket-stamp { transform: none; }
}

@media (forced-colors: active) {
  .v30-reward-pocket,
  .v30-reward-pocket-panel,
  .v30-reward-pocket-stamp { border: 2px solid CanvasText; }
  .v30-reward-pocket::before { background: Highlight; }
}

/* V31 — Reward Passbook */
.v31-passbook {
  margin-top: 18px;
}

.v31-passbook .section-heading {
  align-items: end;
}

.v31-passbook-count {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 11px;
  border: 1px solid rgb(35 69 47 / 24%);
  border-radius: 999px;
  color: #23452f;
  font-size: 0.75rem;
  font-weight: 800;
}

.v31-passbook-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgb(24 20 17 / 14%);
  border-radius: 24px;
  background: #fffaf0;
  box-shadow: 0 12px 28px rgb(43 27 22 / 9%);
}

.v31-passbook-spine {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding-block: 15px;
  background: #6d3e2e;
  color: #fffaf0;
}

.v31-passbook-spine span {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.v31-passbook-spine i {
  width: 22px;
  border-top: 1px dashed rgb(255 250 240 / 48%);
}

.v31-passbook-spine b {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.v31-passbook-main {
  min-width: 0;
  padding: 16px;
}

.v31-passbook-kicker {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.v31-passbook-kicker span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: #23452f;
  font-size: 0.75rem;
  font-weight: 800;
}

.v31-passbook-kicker small {
  color: #746a63;
  font-size: 0.75rem;
}

.v31-passbook-main h3 {
  margin: 11px 0 5px;
  color: #181411;
  font-size: clamp(1.25rem, 5.8vw, 1.55rem);
  line-height: 1.08;
}

.v31-passbook-main > p {
  margin: 0;
  color: #625750;
  font-size: 0.76rem;
  line-height: 1.5;
}

.v31-passbook-main dl {
  display: grid;
  gap: 0;
  margin: 14px 0 0;
}

.v31-passbook-main dl div {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 9px 0;
  border-top: 1px dashed rgb(24 20 17 / 15%);
}

.v31-passbook-main dt,
.v31-passbook-main dd {
  font-size: 0.75rem;
}

.v31-passbook-main dt {
  color: #746a63;
}

.v31-passbook-main dd {
  margin: 0;
  color: #2b1b16;
  font-weight: 800;
  text-align: right;
}

.v31-passbook-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin: 5px 0 13px;
}

.v31-passbook-progress i {
  height: 4px;
  border-radius: 999px;
  background: #e7ded2;
}

.v31-passbook-progress i[data-complete="true"] {
  background: #6d3e2e;
}

.v31-passbook-main .button {
  min-height: 46px;
}

.v31-passbook-history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 20px 2px 9px;
}

.v31-passbook-history-head h3 {
  margin: 0;
  font-size: 0.9rem;
}

.v31-passbook-history-head span {
  color: #746a63;
  font-size: 0.75rem;
}

.v31-passbook-history-list {
  display: grid;
  gap: 8px;
}

.v31-passbook-history {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgb(24 20 17 / 10%);
  border-radius: 18px;
  background: rgb(255 250 240 / 58%);
}

.v31-passbook-history > .pill {
  grid-column: 2;
  justify-self: start;
  max-width: 100%;
  white-space: normal;
}

.v31-passbook-history-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: #eee6dc;
  color: #68412f;
}

.v31-passbook-history > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.v31-passbook-history strong,
.v31-passbook-history span,
.v31-passbook-history small {
  overflow-wrap: anywhere;
}

.v31-passbook-history strong {
  color: #181411;
  font-size: 0.78rem;
}

.v31-passbook-history > div > span {
  color: #6d3e2e;
  font-size: 0.75rem;
  font-weight: 750;
}

.v31-passbook-history small {
  color: #746a63;
  font-size: 0.75rem;
  line-height: 1.35;
}

/* V32 — Reward Passbook recovery lab */
.v32-passbook-demo {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.v32-passbook-demo-toggle {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 13px;
  border: 1px solid rgb(24 20 17 / 14%);
  border-radius: 16px;
  background: #f2eadf;
  color: #2b1b16;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.v32-passbook-demo-toggle span {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.v32-passbook-demo-panel {
  padding: 11px;
  border: 1px solid rgb(24 20 17 / 12%);
  border-radius: 16px;
  background: #fffaf0;
}

.v32-passbook-demo-panel[hidden] {
  display: none;
}

.v32-passbook-demo-panel > p {
  margin: 0 0 8px;
  color: #746a63;
  font-size: 0.75rem;
}

.v32-passbook-demo-panel [role="group"] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5rem, 1fr));
  gap: 6px;
}

.v32-passbook-demo-panel button {
  min-width: 0;
  min-height: 44px;
  padding: 8px 6px;
  border: 1px solid rgb(109 62 46 / 24%);
  border-radius: 13px;
  background: transparent;
  color: #5c5049;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 750;
  cursor: pointer;
}

.v32-passbook-demo-panel button[aria-pressed="true"] {
  border-color: #6d3e2e;
  background: #6d3e2e;
  color: #fffaf0;
}

.v32-passbook-state {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 148px;
  padding: 16px;
  border: 1px solid rgb(24 20 17 / 14%);
  border-radius: 22px;
  background: #fffaf0;
}

.v32-passbook-state > span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: #eee6dc;
  color: #68412f;
}

.v32-passbook-state > div {
  min-width: 0;
}

.v32-passbook-state strong {
  display: block;
  color: #181411;
  font-size: 1rem;
  line-height: 1.25;
}

.v32-passbook-state p {
  margin: 6px 0 12px;
  color: #625750;
  font-size: 0.78rem;
  line-height: 1.5;
}

.v32-passbook-state .button {
  min-height: 44px;
}

.v32-passbook-error {
  border-color: rgb(155 62 37 / 30%);
  background: #fff6ee;
}

.v32-passbook-error > span {
  background: #f6dfd3;
  color: #9b3e25;
}

.v32-passbook-loading {
  align-items: center;
  min-height: 148px;
}

.v32-passbook-loading > i,
.v32-passbook-loading b {
  display: block;
  border-radius: 999px;
  background: #e7ded2;
}

.v32-passbook-loading > i {
  width: 44px;
  height: 44px;
}

.v32-passbook-loading > div {
  display: grid;
  gap: 10px;
}

.v32-passbook-loading b {
  width: 82%;
  height: 12px;
}

.v32-passbook-loading b:first-child {
  width: 58%;
  height: 16px;
}

.v32-passbook-loading b:last-child {
  width: 70%;
}

@media (max-width: 350px) {
  .v31-passbook-card { grid-template-columns: 40px minmax(0, 1fr); }
  .v31-passbook-main { padding: 14px 12px; }
  .v31-passbook-history { grid-template-columns: 36px minmax(0, 1fr); }
  .v32-passbook-demo-panel { padding: 9px; }
  .v32-passbook-demo-panel button { padding-inline: 3px; }
  .v32-passbook-state { grid-template-columns: 40px minmax(0, 1fr); padding: 14px 12px; }
}

@media (forced-colors: active) {
  .v31-passbook-card,
  .v31-passbook-history,
  .v31-passbook-count,
  .v32-passbook-demo-toggle,
  .v32-passbook-demo-panel,
  .v32-passbook-demo-panel button,
  .v32-passbook-state { border: 2px solid CanvasText; }
  .v31-passbook-progress i[data-complete="true"] { background: Highlight; }
  .v32-passbook-demo-panel button[aria-pressed="true"] { background: Highlight; color: HighlightText; }
}
