/* お気に入りの状態と、保存成功時だけのモーション。操作領域の寸法は変えない。 */
.favorite-button { position: relative; overflow: visible; touch-action: manipulation; }
.favorite-heart { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; pointer-events: none; }
.favorite-heart svg { display: block; width: 24px; height: 24px; }
.favorite-button [data-icon-off] { display: inline-flex; }
.favorite-button [data-icon-on] { display: none; color: #c2410c; }
.favorite-button[aria-pressed='true'] [data-icon-off] { display: none; }
.favorite-button[aria-pressed='true'] [data-icon-on] { display: inline-flex; }
.favorite-button[aria-disabled='true'] { cursor: progress; opacity: .65; }
.favorite-button.favorite-added .favorite-heart { animation: favorite-jump 560ms cubic-bezier(.2, .7, .3, 1); }
.favorite-button.favorite-removed .favorite-heart { animation: favorite-pop 300ms ease-out; }
.favorite-button.favorite-removed::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 3px; height: 3px; margin: -1.5px;
  border-radius: 50%; color: #c2410c; pointer-events: none; opacity: 0;
  box-shadow: 0 -12px currentColor, 10px -6px currentColor, 10px 6px currentColor, 0 12px currentColor, -10px 6px currentColor, -10px -6px currentColor;
  animation: favorite-burst 320ms ease-out;
}
.favorite-feedback {
  position: fixed; z-index: 45; left: 50%; transform: translateX(-50%); box-sizing: border-box;
  bottom: calc(var(--member-action-base-height, 76px) + var(--member-safe-bottom, env(safe-area-inset-bottom, 0px)) + 12px);
  width: max-content; max-width: min(448px, calc(100vw - 32px - var(--member-safe-left, 0px) - var(--member-safe-right, 0px)));
  padding: 10px 14px; margin: 0; border: 1px solid #fed7aa; background: #fff7ed; color: #9a3412;
  font-size: 13px; font-weight: 500; line-height: 1.5; box-shadow: 0 2px 12px #2d26221a;
}
.favorite-feedback:empty { padding: 0; border: 0; box-shadow: none; }
.favorite-feedback[data-error='true'] { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.favorite-feedback a { display: inline-flex; min-height: 44px; align-items: center; margin-left: 8px; font-weight: 700; text-decoration: underline; }
.favorite-feedback a:focus-visible { outline: 2px solid #c2410c; outline-offset: 3px; }
/* 未ログインの案内はメンバー・グループ共通。dialogのtop layerで背景操作も止める。 */
body.has-favorite-login-modal { overflow: hidden; }
.favorite-login-modal {
  --favorite-safe-top: var(--member-safe-top, env(safe-area-inset-top, 0px));
  --favorite-safe-bottom: var(--member-safe-bottom, env(safe-area-inset-bottom, 0px));
  --favorite-safe-left: var(--member-safe-left, env(safe-area-inset-left, 0px));
  --favorite-safe-right: var(--member-safe-right, env(safe-area-inset-right, 0px));
  position: fixed; box-sizing: border-box;
  inset: calc(16px + var(--favorite-safe-top)) calc(16px + var(--favorite-safe-right)) calc(16px + var(--favorite-safe-bottom)) calc(16px + var(--favorite-safe-left));
  width: min(384px, calc(100vw - 32px - var(--favorite-safe-left) - var(--favorite-safe-right))); max-width: none;
  max-height: calc(100dvh - 32px - var(--favorite-safe-top) - var(--favorite-safe-bottom));
  margin: auto; padding: 24px; border: 0; border-radius: 0; background: #fff; color: #2d2622;
  overflow-y: auto; overscroll-behavior: contain; box-shadow: 0 12px 48px rgb(45 38 34 / .18);
}
.favorite-login-modal::backdrop { background: rgb(45 38 34 / .48); }
.favorite-login-heading { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; gap: 12px; }
.favorite-login-heading h2 { margin: 0; color: #2d2622; font-size: 18px; font-weight: 700; line-height: 1.5; }
.favorite-login-close { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-height: 44px; padding: 0; }
.favorite-login-close svg { width: 20px; height: 20px; }
.favorite-login-description { margin: 16px 0 24px; color: #736b65; font-size: 14px; line-height: 1.8; }
.favorite-login-primary { display: flex; width: 100%; min-height: 44px; align-items: center; justify-content: center; }
.favorite-login-registration { display: flex; flex-direction: column; align-items: center; margin: 16px 0 0; color: #736b65; font-size: 12px; }
.favorite-login-registration a { display: inline-flex; align-items: center; min-height: 44px; color: #c2410c; font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.favorite-login-modal :is(a, button):focus-visible { outline: 2px solid #c2410c; outline-offset: 3px; }
@media (max-height: 480px) {
  .favorite-login-modal { padding: 16px; }
  .favorite-login-description { margin: 8px 0 12px; }
  .favorite-login-registration { margin-top: 8px; }
}
@keyframes favorite-jump {
  0% { transform: translateY(0) scale(.85); }
  30% { transform: translateY(-22px) scale(1.17); }
  58% { transform: translateY(1px) scale(.95); }
  80% { transform: translateY(-4px) scale(1.04); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes favorite-pop {
  0% { transform: scale(1); }
  28% { transform: scale(.55); opacity: .3; }
  65% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes favorite-burst {
  0% { transform: scale(.25); opacity: 1; }
  100% { transform: scale(1.7); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .favorite-button, .favorite-button .favorite-heart, .favorite-button::after { animation: none !important; transition: none !important; }
}
