/* LAB v3：スマホ=ボトムシート / 横長=右サイドパネル */

/* ここだけ変えればボトムシートの高さ上限を調整できます */
:root{ --mopi-sheet-max-height: 60vh; }

.mopi-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 9998;
}

/* Bottom sheet (スマホ: 上40%を空ける = 最大60vh) */
.mopi-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-height: var(--mopi-sheet-max-height, 60vh);
  overflow: auto;
  background: #f7f7f7;
  border-top: 1px solid #ccc;
  border-radius: 16px 16px 0 0;
  padding: 0.9rem 0.9rem calc(1rem + env(safe-area-inset-bottom));
  z-index: 9999;
  box-shadow: 0 -8px 24px rgba(0,0,0,.12);
}

.mopi-sheet__header { position: relative; padding-right: 4.5rem; }
.mopi-sheet__close {
  position: absolute; right: 0; top: 0;
  border: 1px solid #bbb; background: #fff;
  border-radius: 10px; padding: 0.25rem 0.5rem;
  font-size: 0.8rem; cursor: pointer;
}

.mopi-sheet__title {
  font-weight: 650;
  font-size: 1.0rem;
  line-height: 1.35;
  color: #111;
}

.mopi-sheet__meta { margin-top: 0.35rem; font-size: 0.85rem; color: #333; }
.mopi-link { color: #111; text-decoration: underline; text-underline-offset: 2px; }
.mopi-sheet__desc { margin-top: 0.55rem; font-size: 0.9rem; color: #222; white-space: pre-wrap; }

/* Actions */
.mopi-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.mopi-action {
  appearance: none;
  border: 1px solid #bbb;
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  color: #111;
  background: #fff;
}
.mopi-action--solid { background: #fff; }
.mopi-action--ghost { background: transparent; }

/* Offers */
.mopi-section { margin-top: 0.95rem; padding-top: 0.75rem; border-top: 1px solid #ddd; }
.mopi-section__title { font-size: 0.9rem; font-weight: 650; color: #111; margin-bottom: 0.55rem; }

/* divider between "受付・リンク" and "案内" inside the detail sheet */
.mopi-divider { height: 1px; background: #e6e6e6; margin: 0.9rem 0; }

.mopi-offer {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 14px;
  padding: 0.7rem 0.75rem;
  margin-bottom: 0.6rem;
}
.mopi-offer__top { display: flex; gap: 0.5rem; align-items: center; }
.mopi-badge {
  display: inline-block;
  border: 1px solid #bbb;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  color: #111;
  background: #f5f5f5;
  white-space: nowrap;
}
.mopi-offer__title { font-size: 0.9rem; font-weight: 600; color: #111; line-height: 1.3; }
.mopi-offer__meta { margin-top: 0.35rem; font-size: 0.82rem; color: #333; white-space: pre-wrap; }
.mopi-offer__btns { display: flex; gap: 0.5rem; margin-top: 0.65rem; flex-wrap: wrap; }

/* Side panel (wide screens) */
.mopi-sidepanel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 42vw);
  height: 100vh;
  background: #f7f7f7;
  border-left: 1px solid #ccc;
  z-index: 9999;
  box-shadow: -8px 0 24px rgba(0,0,0,.12);
  display: flex;
  flex-direction: column;
}

.mopi-sidepanel__head {
  padding: 0.75rem 0.75rem;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mopi-sidepanel__hint { font-size: 0.85rem; color: #333; font-weight: 650; }

.mopi-sidepanel__close {
  border: 1px solid #bbb;
  background: #fff;
  border-radius: 10px;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.mopi-sidepanel__body {
  padding: 0.9rem 0.9rem 1rem;
  overflow: auto;
}

/* Toast */
.mopi-toast {
  position: fixed;
  left: 50%;
  bottom: calc(0.75rem + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(12px);
  background: rgba(20,20,20,.9);
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 10000;
}
.mopi-toast--show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 640px) {
  .mopi-action { padding: 0.6rem 0.85rem; font-size: 0.95rem; }
}

@media (min-width: 900px) {
  /* wide時はオーバーレイ不要（サイドパネル）なので見た目だけ調整したい場合ここへ */
}


/* Offer card clickable */
.mopi-offer--clickable { cursor: pointer; }
.mopi-offer--clickable:active { transform: translateY(1px); }
.mopi-offer--clickable:focus { outline: 2px solid #999; outline-offset: 2px; }


/* Offer card non-clickable (info) */
.mopi-offer--static { cursor: default; opacity: 0.95; }
.mopi-offer--static:active { transform: none; }

/* v13: 常設リンク（例: 小倉萌さんX）を中央寄せ */
.mopi-offer--center .mopi-offer__top{
  justify-content: center;
}
.mopi-offer--center .mopi-offer__title{
  text-align: center;
}


/* ---- v13 patch: group non-clickable offers to reduce duplication ---- */
.mopi-offer__list{
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.mopi-offer-item{
  border-top: 1px dashed #e2e2e2;
  padding-top: 0.5rem;
}
.mopi-offer-item:first-child{
  border-top: 0;
  padding-top: 0;
}
.mopi-offer-item__row{
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}
.mopi-offer-item__title{
  font-weight: 600;
}
.mopi-offer-item__meta{
  font-size: 0.85rem;
  color: #444;
  white-space: nowrap;
}
.mopi-offer-item__note{
  margin-top: 0.2rem;
  font-size: 0.85rem;
  color: #333;
}
