header {
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(5px);
  padding: 10px 16px;
  border-bottom: 1px solid #eaeaea;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  transition: transform .3s;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}

.brand .img {
  width: 40px;
  height: 40px;
  position: relative;
}

.brand img {
  width: 100%;
  border-radius: 50%;

}

.brand p {
  font-weight: bold;
  font-size: 13px;
  color: var(--text-main);
  margin: 0;
}

.progress-container {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-bottom: 18px;
}

.progress-line {
  position: absolute;
  top: 50%;
  width: 100%;
  transform: translateY(-50%);
  left: 0;
  height: 2px;
  background: #e0e0e0;
  z-index: 0;
}

.progress-fill {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 0;
  height: 2px;
  background: var(--primary);
  z-index: 0;
  width: 0%;
  transition: width .5s;
}

.step {
  position: relative;
  width: 22px;
  height: 22px;
  color: #fff;
  display: flex;
  align-items: center;
  font-size: 12px;
  justify-content: center;
  background: #e0e0e0;
  border-radius: 50%;
  z-index: 1;
  position: relative;
  transition: .3s;
}

.progress-container .step::before {
  content: attr(data-label);
}

.step::before {
  color: #ddd;
  font-size: 10px;
  position: absolute;
  top: calc(50% + 20px);
  left: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.step.active {
  background: var(--primary);
  transform: scale(1.2);
}

.step.active::before {
  color: var(--primary);
  font-weight: bold;

}

#main-area {
  flex: 1;
  overflow-y: auto;
  padding-inline: 1rem;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 12px;
}

.catalog-container {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-top: 16px;
  padding-inline: 16px;
  margin: 0 -16px 0 -16px;
  /* scroll-snap-type: x mandatory; */
  /* scrollbar-width: none; */
  transition: opacity .3s, height .3s;
}

.catalog-container::-webkit-scrollbar {
  display: none;
}

.catalog-container.fade-out {
  opacity: 0;
  pointer-events: none;
  height: 0;
  margin: 0;
  padding: 0;
}

.product-card {
  flex: 0 0 260px;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  /* scroll-snap-align: center; */
  border: 1px solid #eee;
  display: flex;
  flex-direction: column;
}


.p-thumb {
  position: relative;
  height: 250px;
  background-size: cover;
}



.p-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.p-title {
  font-weight: bold;
  font-size: 15px;
}

.p-price {
  color: var(--primary);
  font-weight: bold;
  font-size: 17px;
  margin-top: auto;

}

.p-btn {
  padding: 10px;
  background: var(--primary);
  color: #fff;
  text-align: center;
  font-weight: bold;
  cursor: pointer;
  border: none;
  width: 100%;
  border-radius: 6px;
  font-size: 12px;
  border: 1px solid var(--primary);
}

.p-btn[disabled] {
  color: #fff;
  background: #ddd;
  border: none;
}

.msg {
  max-width: 88%;
  padding: 12px 16px;
  font-size: 15px;
  line-height: 1.6;
  position: relative;
  animation: fadeIn .3s forwards;
  opacity: 0;
  transform: translateY(10px);
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.msg.sys {
  background: var(--card-bg);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  align-self: flex-start;
  box-shadow: var(--shadow);
  border: 1px solid #f0f0f0;
  margin-right: auto;
}

.msg.sys::before {
  content: "";
  position: absolute;
  top: 0;
  left: -6px;
  width: 0;
  height: 0;
  border-top: 10px solid var(--card-bg);
  border-left: 10px solid transparent;
}

.msg.sys:has(.product-card) {
  padding: 0;
  background: none;
  box-shadow: none;
  border: none;
}

.msg.sys:has(.product-card)::before {
  display: none;
}

.msg.user {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius) 0 var(--radius) var(--radius);
  align-self: flex-end;
  margin-left: auto;
  box-shadow: 0 2px 8px rgba(0, 86, 179, .2);
}

.typing {
  display: inline-flex;
  gap: 4px;
  padding: 10px 14px;
  background: #fff;
  border-radius: 20px;
  align-self: flex-start;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  display: none;
  width: fit-content;
}

.dot {
  width: 6px;
  height: 6px;
  background: #bbb;
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out;
}

.dot:nth-child(1) {
  animation-delay: -.32s;
}

.dot:nth-child(2) {
  animation-delay: -.16s;
}

@keyframes bounce {

  0%,
  80%,
  100% {
    transform: scale(0);
  }

  40% {
    transform: scale(1);
  }
}

.info-box {
  background: #f0f4f8;
  border: 1px dashed #0056b3;
  padding: 12px;
  border-radius: 8px;
  margin-top: 8px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.info-label {
  font-weight: bold;
  color: #555;
}

.info-val {
  font-family: monospace;
  font-size: 16px;
  background: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  margin-inline: auto;
}

.secure-id {
  font-size: 20px;
  letter-spacing: 2px;
  font-weight: bold;
  text-align: center;
  padding: 12px;
  background: #333;
  color: #fff;
  border-radius: 8px;
  margin-top: 8px;
}

footer {

  background: rgba(255, 255, 255, .98);
  border-top: 1px solid #eaeaea;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, .05);
}

footer:has(.openXPost) {
  display: block;
}

footer:has(#paypay-link-input) {
  flex-wrap: wrap;
}

footer:has(#paypay-link-input) button {
  flex: 0 0 calc(50% - 5px);
}

footer.show {

  padding: 12px 16px calc(12px + var(--x-inapp-bottom));

}

.action-btn {
  width: 100%;
  padding-block: .75rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  transition: .2s;
  display: flex;
  justify-content: center;
  align-items: center;
}

.action-btn:active {
  transform: scale(.98);
}

.action-btn.secondary {
  background: #fff;
  color: var(--text-sub);
  border: 1px solid #ddd;
  font-size: 14px;
}

.pay-link {
  display: block;
  text-decoration: none;
  background: #FF0033;
  color: #fff;
  padding: 12px;
  text-align: center;
  border-radius: 8px;
  font-weight: bold;
  margin-top: 1rem;
}

.sub-link {
  text-align: center;
  font-size: 13px;
  color: #666;
  text-decoration: underline;
  padding: 4px;
  cursor: pointer;
}

/* 簡易トースト */
#toast {
  position: fixed;
  left: 50%;
  bottom: 110px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, .8);
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: 9999;
}

#toast.show {
  opacity: 1;
}


/* 右下の丸ボタン */
.thumb-resize-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: none;
  background: rgba(0, 0, 0, .45);
  /* 薄暗い黒 */
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
}

.thumb-resize-btn:active {
  transform: scale(.96);
}

.thumb-resize-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  opacity: .95;
}



.thumb-resize-btn:active {
  transform: scale(.96);
}

.thumb-resize-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  opacity: .95;
}



.rating-line {
  font-size: 12px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rating-stars {
  letter-spacing: 1px;
  color: #f5b301;
}

/* 星だけ少し目立たせる */
.rating-count {
  color: #666;
}

.notifyBtn {
  background: none;
  border: 1px solid var(--primary);
  color: var(--primary);
  font-weight: normal;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  text-decoration: none;
  font-size: 12px;
}